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. Android Party shuffle

I was looking at Android music code to understand what party shuffle
does. It appears that all that party shuffle does is to create a
playlist whose length is the position of the song on the list + 7, and
add a random selection of songs from the phone on to this list. Unlike
normal shuffle, it seems a party shuffle does not care if the songs
are repeated.
Is this correct? And what is the big picture behind this feature?


2. User Identity

I'm looking for a way to determine user identity so I can globally
track game scores off phone.

IMEI provides identity of the phone - not effective if phone is on-
traded or upgraded by individual.
USIM provides identity of phone carrier subscriber - assumes device is
phone, and currently has a SIM card

I'd like to be able to provide continuity as a user upgrades to a new
And I dislike being forced to create an account on each global scoring
system, so I don't want to force that on my users. And my end user
experience with OpenFeint leaves me disinclined to use it.

It doesn't need to be bullet proof. But it does need to be hassle free
for my users.

Is there any other identifier on an Android device that I can use to
link data more cleanly with the current owner?
And how would I get hold of that identifier?
I'm thinking something like the user's Google account .. or similar


3. Rotate floating AVD

4. How to place buton on desired place.

5. Can麓t animate ImageView

6. htop ncurses static library

7. opening L2CAP socket: Operation not permitted