On Mon, Oct 10, 2011 at 11:04 AM, Pinheiro <rui.c.pinhe...@gmail.com> wrote:
>> Not if you are using PARTIAL_WAKE_LOCK. You need a FULL_WAKE_LOCK. As> the 
>> documentation states for ACQUIRE_CAUSES_WAKEUP:
>  Thanks but that doesn't solve my problem, I really, really want to
> turn the screen off after some time of inactivity and turn it on only
> after a message arrives or the user touches the screen or button.

That really really is not possible. You can drop from a FULL_WAKE_LOCK
to a PARTIAL_WAKE_LOCK easily enough, but then you will not receive
any user input ("touches the screen or button") once you are on the
PARTIAL_WAKE_LOCK.

> I'm
> starting to think PARTIAL_WAKE_LOCK won't work and I'll have to use
> timers to turn screen off by releasing a FULL_WAKE_LOCK. I never
> thought turning the screen on and off would be so difficult.

It's not. It's trying to get user input that is your problem. Please
allow the user to simply use the power button, like the user is
already used to, and your problem becomes much simpler.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
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