Forums Register Login

WakeLock acquire() method sometimes takes 30 seconds to turn on the screen

+Pie Number of slices to send: Send

Background My previous Android tablet's power switch became dodgy and took several presses and wiggles to work. Very annoying. I looked at a program: Shake that would wake up a tablet when the tablet was shaken.  But it wasn't 100% reliable.  So I wrote my own wakeup program to turn on the screen when the tablet was raised ~70 deg from horizontal.

The problem It usually works as desired, however some times it takes ~30 seconds to turn on.

My question is: Is there anything I can do to make it 100% reliable?

The debug output:


WU Sensor values=[-6.454, 1.034, 4.549], hitCount=1, cnt=84421 at T 17:01:17
WU Sensor values=[-9.96, 1.063, 2.499], haveShown=false, hitCount=1, cnt=84424 at T 17:01:18
Sensor values=[-9.96, 1.063, 2.499], since last=9255866, cnt=84425, hitCount=2 at T 17:01:18
ScrnOnOffSrvc turnOnScreen acquire at T 17:01:18  <<<< Before call to acqquire
ScrnOnOffSrvc Turned on screen at T 17:01:48 ScreenOn=true  <<<<<<<<<<<<<<< 30 seconds later<<<<<<<<<



The source for the above:

The full code is here: https://github.com/NormR/Wakeup
+Pie Number of slices to send: Send
This has fallen off the first page, so I'll bump it back to see if anyone has any ideas on how to overcome the Android system's sometimes keeping the app from opening the screen for 30 seconds.
You don't like waffles? Well, do you like this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1302 times.
Similar Threads
Why does program sometimes wait 30 seconds?
Wake Lock Not Working in Android
Activity Expired Time Out From BroadcastReceiver (need ASAP solution)
Doubt in thread synchronization
Dismissing Alarm when user uses Back or Home
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 00:55:20.