@Thilo-Alexander,

I am having the exact same problem as you!  I am developing a download
manager for a particular site and have a service that aquired
PARTIAL_WAKE_LOCK, but when the screen blanks (I press power) the
download pauses.  Downloads make no progress at all when the screen is
off.  If I do a FULL_WAKE_LOCK, I get the expected behavior (screen/
CPU are on full blast).

Did you ever find a solution?

-Jack

On Apr 25, 1:23 pm, Thilo-Alexander Ginkel <th...@ginkel.com> wrote:
> On Apr 25, 9:59 pm, Thilo-Alexander Ginkel <th...@ginkel.com> wrote:
>
> > > The weird thing is, the problem goes away if I use
> > > SCREEN_DIM_WAKE_LOCK instead.  But I really don't want to drain my
> > > users' batteries needlessly.
>
> > That looks somewhat similar to the problem I described at:
> >  http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > Seems as if HTC are applying some very aggressive power saving when
> > the screen is turned off. Unfortunately, I do not yet have a solution
> > (there must be one [most likely undocumented] as the native phone
> > application is not affected).
>
> After reading the PowerManager source code, I figured out that there
> seems to be an undocumented wake lock for the CPU, which is used along
> with a SCREEN_DIM_WAKE_LOCK, but not with a PARTIAL_WAKE_LOCK:
>
> -- 8< --
>     private static final int WAKE_BIT_CPU_STRONG = 1;
>     private static final int WAKE_BIT_CPU_WEAK = 2;
>     [...]
>
>     /**
>      * Wake lock that ensures that the CPU is running.  The screen
> might
>      * not be on.
>      */
>     public static final int PARTIAL_WAKE_LOCK = WAKE_BIT_CPU_STRONG;
>     [...]
>
>     /**
>      * Wake lock that ensures that the screen is on (but may be
> dimmed);
>      * the keyboard backlight will be allowed to go off.
>      */
>     public static final int SCREEN_DIM_WAKE_LOCK = WAKE_BIT_CPU_WEAK |
> WAKE_BIT_SCREEN_DIM;
> -- 8< --
>
> Can you try what happens if you acquire the wake lock with the
> WAKE_BIT_CPU_WEAK set? I'd try it myself, but am a little short on
> time right now.
>
> Regards,
> Thilo
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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

Reply via email to