This guide provides instructions on how to manually test suspend and resume on a device running a suitable Workbench image.
Perform manual suspend and resume
With serial
Connect to the device via USB.
Take an Application Activity lease via
ffx power's helper component:ffx power system-activity application-activity startDrop the session wake lease:
ffx session drop-power-leaseDisconnect USB to eliminate the persistent wake lease caused by the USB or charger connection.
Using serial, drop the Application Activity lease and reacquire it after a delay:
powerutil system-activity application-activity restart --wait-time 5sThis will allow the system to suspend as long as no other wake leases are active.
Wait until serial logs show evidence of system suspension. Logs are not necessarily flushed prior to suspension, so you may see them abruptly stop.
Reconnect USB or take another suitable action (touch, button press, etc.) to resume the device. If
--wait-timehas elapsed, the helper component will reacquire an Application Activity lease and prevent further suspension on its own.
Without serial
Connect to the device via USB.
Take an Application Activity lease via
ffx power's helper component:ffx power system-activity application-activity startDrop the session wake lease:
ffx session drop-power-leaseDrop the Application Activity lease and reacquire it after a delay:
ffx power system-activity application-activity restart --wait-time 5sDisconnect USB to eliminate the persistent wake lease caused by the USB or charger connection.
Wait for several seconds. Without a serial connection, you will not be able to confirm whether suspension has occurred until you replug the device.
Reconnect USB.
Use
ffx logto look for evidence of suspension. There isn't a canonical message to indicate this, but at time of writing, the kernel messageINFO: Suspending non-boot CPUs...is a good indicator.
Troubleshooting
Check wake leases
Any active wake leases prevent the system from suspending. To check active wake leases:
Serial
inspect show bootstrap/system-activity-governor:root/wake_leasesUSB
ffx inspect show bootstrap/system-activity-governor:root/wake_leasesIncrease delay before wake lease reacquisition
To give the system longer to suspend, increase the delay using the --wait-time
option:
powerutil system-activity application-activity restart --wait-time 10s