Win a copy of Head First Go this week in the Go forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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

 
Rancher
Posts: 3353
33
  • 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
 
Norm Radder
Rancher
Posts: 3353
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!