If a full wake lock is enabled does the wakelock automatically get released when the device is locked

StackOverflow https://stackoverflow.com/questions/13104222

  •  14-07-2021
  •  | 
  •  

Question

I am working on an android project where I am using PowerManager.FULL_WAKE_LOCK to make sure the screen stays on at all times.

I was wondering if the user locks the device while the wake lock has been aquired whether the wakelock will automatically be released or whether I would need to handle this myself.

I did a google search but couldn't come up with anything.

Thanks

Was it helpful?

Solution

You should still have the lock, please note that once you release the lock the device may instantly go to standby if the timeout time has been reached while you still held the lock. So if some automatic event releases the lock, the screen might instantly turn black.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top