Android Question Wake state and timers

nibbo

Active Member
Licensed User
Longtime User
OK, it seems that timers stop when tablets 'go to sleep'; i.e. the display timeout is reached.
I can use the PhoneWakeState to keep it alive but this will cause battery drain due to keeping the screen on all of the time albeit dimmed.
Is there a way to keep the process running but allow the screen to switch off thus keeping timers running without reducing battery time?
I thought that was what partial lock was for but this too seems to keep the screen on but dimmed.

Out of curiosity; what is the difference between PartialLock and KeepAlive(False)?

Thanks
 
Last edited:

nibbo

Active Member
Licensed User
Longtime User
PartialLock will not prevent the screen from turning off and will keep the cpu running.

Thanks for the reply Erel,
That is what I thought, however, when trying partial lock the screen is still on but dimmed and never goes completely blank.
 
Upvote 0

nibbo

Active Member
Licensed User
Longtime User
Make sure that there isn't any other call to PhoneWakeState.
This is how this API should work.

Hi again Erel, apologies for taking so long to confirm this but got dragged onto another project.
I have searched through the entire app and the only PhoneWakeState's I can find are PartialLock never KeepAlive but still the tablet stays awake but dimmed.
 
Upvote 0

nibbo

Active Member
Licensed User
Longtime User
All a bit strange.
I tried the same app on a Motorola Xoom a galaxy tab2, 3 & 4 using the PartialLock option.
The xoom, tab 2 & tab 4 all went to sleep and the timer operation stopped.
The tab 3 keeps going but the dimmed screen stays on.
Also wrote a little test for a galaxy s5 phone and the screen stays on in dimmed mode.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…