Not using a WakeLock so why does the device stay awake?

by westmeadboy » Tue, 13 Apr 2010 19:56:17 GMT

Sponsored Links
 Hmmm, so in that case, why does the device not sleep after the user
has used the power button to turn off the screen? Or do you mean that
the activity is still considered in the foreground even after that?


Not using a WakeLock so why does the device stay awake?

by westmeadboy » Wed, 14 Apr 2010 15:19:10 GMT

 So I tried this:

Start service
Press Home
Start some other 3rd party app (so that activity is in the foreground)
Press power button to blank screen

A few minutes later, I press the power button to unblank the screen
and discover the service finished successfully.

This means the phone never went to sleep...

Any ideas why?


Sponsored Links

Not using a WakeLock so why does the device stay awake?

by THill » Fri, 23 Apr 2010 01:52:44 GMT

 I've seen similar behavior as the OP.

I have a simple activity that starts a timer in onCreate, logging a
message every second.  No wake lock is requested, so after the time
indicated in setting, the device sleeps (allowed to dim, then sleep
naturally, not with power button press).  After letting it sit like
that for a few minutes, I plug it in via USB & check the logs, where I
can see the timer continued running through the sleep.

If I then do 'adb shell dumpsys power', the only wake locks shown are:
  SCREEN_DIM_WAKE_LOCK           'StayOnWhilePluggedIn Screen Dim'
activated (minState=1)
  PARTIAL_WAKE_LOCK              'StayOnWhilePluggedIn Partial'
activated (minState=0)

which makes sense since the device is now plugged in via USB.

Is this expected behavior?  Seems to go against the idea that all
threads are suspended during the sleep...

Thanks for any clarification,


Other Threads

1. AdSense for Mobile Content New high-end devices!

Is there anyone here aware of the new Adsense for Mobile Content adverts by

You should be able to see these in your adsense account.

AdSense for Mobile Content <> New
high-end devices!

I'd like to know if there is anyone here incorporating them into their app,
or webview?

What are the results? has Google OK'd it? is it OK?

I noticed that it produces the same results as the SDK, but if you have a
webview component already, it is easier to give it the adsense javascript.

Many thanks for any information you can share about this new adsense

Best Regards,



2. Good EULA idea

I know that users of apps even paid one hate to click through a EULA.  
Some of the developers think they're important.  To pop one up even on 
first run using the example code is actually tricky and sloppy in some 
cases.  I do that but I'm going to remove them.  The free apps I've 
downloaded to the phone so far don't even have EULAs.   And today I 
download the free Adobe Photoshop.  In their description they say by 
downloading the app you are agreeing to the EULA and provide the web 
link for it.  If that works for Adobe it should work for anyone else.  

Brian Conrad


3. How to change application theme at runtime

4. Installing custom built SDK

5. Android - NPE in BrowserFrame

6. Great Idea in need of better JAVA pro

7. Motorola Android Improvements