Menu

FLAG_KEEP_SCREEN_ON Not Working on Android: The Screensaver
πŸ“°

FLAG_KEEP_SCREEN_ON Not Working on Android: The Screensaver

DEV Community: androidΒ·cometa-kaitoΒ·about 9 hours ago
#8QUComIQ
#devtoandroid#devto#dev#settings#shell
Reading 0:00
15s threshold

The answer

It's the screensaver (Daydream).

FLAG_KEEP_SCREEN_ON and disabling sleep run on a separate track from the screensaver. It fires in the instant the flag isn't in effect , so it's the one thing left standing after you've blocked everything else.

adb shell settings put secure screensaver_enabled 0 adb shell settings put secure screensaver_activate_on_sleep 0 adb shell settings put secure screensaver_activate_on_dock 0

Enter fullscreen mode

Exit fullscreen mode

And these settings reset on reboot . Stop before that step and you'll think it's fixed when it isn't.

The symptom

A display meant to stay on goes black after a while

The device itself is alive β€” processing keeps running

FLAG_KEEP_SCREEN_ON is already set

Sleep timeout is already extended

It still goes dark, and you can't predict when

The unpredictability is the tell.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.