• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic