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. Arabic support

Please help me!!!!
i have 2 probleams
1. i don't know how can i connect my mobile to pc
2.can anyone help me please to install arabic language on my Android
G1 (( t-mobile))
i realy need install this language.



2. How can I put a linearlayout in a grid of the gridview?

this is what I did in the adapter class. but its not working.

    public View getView(int position, View convertView, ViewGroup
parent) {
        ThumbnailProfile profile = profiles.get(position);
        LinearLayout thumbnailProfileView = new LinearLayout(online);
        thumbnailProfileView.setLayoutParams(new GridView.LayoutParams
(85, 10));

        TextView username = new TextView(online);
        TextView basicInfo = new TextView(online);
        basicInfo.setText(profile.getAge() + ", " + profile.getHeight() +
", " + profile.getWeight());

        ImageView imageView;
        if (convertView == null) {  // if it's not recycled,
initialize some attributes
            imageView = new ImageView(online);
            imageView.setLayoutParams(new GridView.LayoutParams(85,
            imageView.setPadding(8, 8, 8, 8);
        } else {
            imageView = (ImageView) convertView;
        Bitmap pic = getImageBitmap(profiles.get
        return thumbnailProfileView;


3. a problem with SMS api

4. MMS + MP3

5. Listeners not listening after back button

6. Txt Messages Got Deleted

7. How to connect with another bluetooth device through given uuid.