[英]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
). 我的应用程序将手机从待机状态唤醒,并打开了屏幕(
SCREEN_BRIGHT_WAKE_LOCK
)。 I can't use the WindowManager-flags approach, as my app may already be running in the background. 我不能使用WindowManager-flags方法,因为我的应用程序可能已经在后台运行。
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). 问题在于,一旦用户关闭了我的应用程序并释放了WakeLock,即使用户正在与该应用程序进行交互(或在关闭该应用程序时短暂显示的主屏幕),屏幕也会立即关闭。
Would using the ON_AFTER_RELEASE
-flag help? 使用
ON_AFTER_RELEASE
-flag帮助吗?
Yes, you want to use the ON_AFTER_RELEASE
flag. 是的,您想使用
ON_AFTER_RELEASE
标志。
When this wake lock is released, poke the user activity timer so the screen stays on for a little longer.
释放此唤醒锁后,请拨动用户活动计时器,以使屏幕停留一会儿。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.