Win a copy of Spring in Action (5th edition) this week in the Spring 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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

 
Rancher
Posts: 3312
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: 3312
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!