Just to confirm: the device is not plugged into USB and I'm not using
any broadcasts or broadcast receivers.

When I do plug in and start the service these are the wake locks:

mLocks.size=3:
  SCREEN_DIM_WAKE_LOCK           'StayOnWhilePluggedIn Screen Dim'
activated (minState=1)
  PARTIAL_WAKE_LOCK              'StayOnWhilePluggedIn Partial'
activated (minState=0)
  SCREEN_BRIGHT_WAKE_LOCK        'KEEP_SCREEN_ON_FLAG' activated
(minState=3)

and then when I homescreen, other app, turn the screen off (as
describe above) but leave the device plugged in, the third one
disappears.

So I would assume that when I unplug the USB, the first two to
disappear also...

On Apr 14, 9:35 am, Dianne Hackborn <[email protected]> wrote:
> Use this to see what wake locks are being held in user space:
>
> adb shell dumpsys power
>
> Note that the device never goes to sleep while plugged in to USB.  Also the
> system will never hold a wake lock for you just because you have an activity
> or service running.  You can have it do so for you in an activity via
> FLAG_KEEP_SCREEN_ON in a window, and the alarm manager will temporarily hold
> one for you while sending an alarm broadcast to a broadcast receiver.
>
> On Wed, Apr 14, 2010 at 12:18 AM, westmeadboy <[email protected]>wrote:
>
>
>
>
>
> > 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?
>
> > On Apr 13, 2:01 pm, Mark Murphy <[email protected]> wrote:
> > > westmeadboy wrote:
> > > > 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?
>
> > > My guess is that it is still considered the foreground until a real
> > > activity (i.e., not the lock screen) takes the foreground.
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com|
> >http://twitter.com/commonsguy
>
> > > Android Training in NYC: 4-6 June 2010:http://guruloft.com
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%2Bunsubs 
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> > To unsubscribe, reply using "remove me" as the subject.
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to