Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Rancher
Posts: 2968
32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!