Basic Usage

Preventing system suspension to handle an event

If you want to keep the system awake to process an event, which might be an interrupt or responding to a FIDL request, there is a very simple API for this. fuchsia.power.system/ActivityGovernor.AcquireWakeLease returns a LeaseToken which prevents system suspension as long as the token exists. If you are a driver processing an interrupt, you can ACK the interrupt after getting the LeaseToken. After you are done processing the event, simply drop the LeaseToken.

There are actually not that many use cases that are this simple on Fuchsia. Many use cases require keeping the system awake while passing the event along to another component. The next section discusses this use case.