FireOS, prevent from sleep mode but allow ambient mode

287 views Asked by At

I have a Media App which just playing some music on the TV. There is no Video Content at all.

On Google TV, the app is still playing, and after a time the ambient mode is starting. So there is no issue.

On FireTV it's different. Without any changes at the current code, the FireOS stops playing the app after 20 minutes and goes into sleep mode.

I know i can:

  • disable the screensaver
  • remove this timeout with adb commands

But nobody want this.

Another way to prevent this, is by adding the flag FLAG_KEEP_SCREEN_ON. But with adding FLAG_KEEP_SCREEN_ON the device is always on until i clear the flag (after stoping the media e.g.). But the ambient mode is never starting. Thats exactly what the flag is made for, but in my case, i want the ambient mode, but not the sleep mode.

Is there a solution to prevent the FireOS from sleep mode, but allow the ambient mode?

1

There are 1 answers

3
GioLaq On

Set a Partial Wake Lock

In this doc it says the apps playing audio should set it https://developer.amazon.com/docs/fire-tv/faq-general.html