简体   繁体   中英

WakeLock.release() switches off screen even if the user was interacting with the app

My app wakes the phone from standby and turns on the screen ( SCREEN_BRIGHT_WAKE_LOCK ). I can't use the WindowManager-flags approach, as my app may already be running in the background.

The problem is that once the user dismisses my app and the WakeLock is released, the screen turns off immediately, even if the user was interacting with the app (or the homescreen, which briefly shows while the app is being closed).

Would using the ON_AFTER_RELEASE -flag help?

Yes, you want to use the ON_AFTER_RELEASE flag.

When this wake lock is released, poke the user activity timer so the screen stays on for a little longer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM