Power
The power manager service controls the top level power state of the device. It is responsible for controlling the following functions:
System reboot and shutdown control
Opportunistic suspend
Scheduled reboots
Negotiating the suspend and shutdown sequence between the system and various services
Opportunistic suspend
To reduce power consumption the system will enter suspend as frequently as possible, if the system needs to perform work it should request power during that work.
There is a special pin in the harness called ONSW which can also be used to prevent the system from going into suspend.
The system can be woken up through various means, such as CAN, Digital I/O, Modem Data, RTC and of course the ONSW.
Scheduled reboots
If the device needs to do a scheduled reboot the guest system will be informed via the power_reboot_pending_publish_ind IPC message. This message will arrive with good margins (hours in advance) to allow the guest system to prepare and reboot voluntarily.
Note that the power_reboot_pending_publish_ind IPC message will not arrive for regular reboots.
If this message is ignored the device will eventually force a reboot.
Suspend and shutdown interest
Services that need to perform actions on suspend or shutdown should register interest. Registering interest allows the services to acknowledge when they are ready for the suspend or shutdown to take place. The shutdown interest also applies to reboots.
This is separate from subscribing to the events themselves, it’s still required to register to the indications.
Note that the system may continue running for a brief period after the acknowledgement has been sent if other parts of the system also registered interest and aren’t ready yet.
It’s possible to subscribe without registering interest to get the notifications for e.g. logging purposes.