Shutdown will be invoked for power-off request
– May from the power key of framework or the shutdown request of applications
Shutdown is responsible for
– Emit deinit events
– Play animation
– Deinit protocol
– Wait for asynchronous deinits of applications
– Send power off request
Note: For non-normal power-on(e.g. USB, alarm) or the case of srv_shutdown_exit_system() is called directly, shutdown application will not be launched
venusmmi/app/Cosmos/Shutdown Application source code
VappShutdownApp itself only shows the shutdown animation
Applications register asynchronous deinit procedure in the flow control, they will be invoked during animation playing
– E.g. MMS, browser, call log
1.Block
Flow control
– When srv_shutdown_normal_start() is called, the flow control module takes over the execution
– Flow control uses framework procedure mechanism to handle the flow
– It controls the time of deinit events and exit system
Deinit protocol
Deinit protocol
– Registers a procedure in flow control
– Invoke shutdown service to deinit protocol
VappShutdownApp
– Used to play animation
– Creates VappAniPage for the animation page
2.Class
Flow control
– Uses framework procedure
– Shutdown itself or applications provide the interface of procedure and register in g_vapp_shutdown_main_flow[]
VappShutdownApp
– Creates VappAniPage to play animation
DEINIT_PROTOCOL
– Invoke shutdown service to deinit protocol asynchronously
DEINIT_APP
– First of all, invoke shutdown service to emit a DEINIT event to applications
ANIMATION
– Play shutdown animation
– At the same time, perform asynchronous deinits, such as protocol deinit, WAP deinit
DEINIT_PROTOCOL
– Detach network
Calls srv_shutdown_exit_system() to power off finally