Message info
 
To:android-developers@googlegroups.com From:Dianne Hackborn Subject:Re: [android-developers] Difference between user-induced "screen on" and programmatically induced "screen on". Date:Thu, 5 Apr 2012 13:46:18 -0700
 

You can know that the screen is currently off, you acquired the wake lock, so when you see the screen go on it is probably due to you.

This has race conditions, but I don't think there is any point in trying to reduce them because what you are asking to do is fundamentally racy: the user could press the power key at any point between when you check whether the screen is currently on and get the final SCREEN_ON broadcast, so during that time what does it really matter what you decide you should do?

On Wed, Apr 4, 2012 at 12:06 AM, Put_tiMe <puttime@gmail.com> wrote:
Sorry, a slight correction:
If it's a code induced screen-on, I want to switch bluetooth on/off (toggle).
If it's a user induced screen-on, I want to switch bluetooth on.
Code induced screen-onis initiatedfrom Alarm-manager.

On Wednesday, April 4, 2012 12:26:49 PM UTC+5:30, Put_tiMe wrote:
If it'sa code induced screen-on, I want to switchbluetooth off.
If it's a user induced screen-on, I want to switch bluetooth on.
On Wednesday, April 4, 2012 10:10:09 AM UTC+5:30, TreKing wrote:
On Tue, Apr 3, 2012 at 4:21 AM, Put_tiMe <puttime@gmail.com> wrote:
I want to handle this intent in different ways, depending on where it originated from.

You still didn't explain why.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Dianne Hackborn
Android framework engineer
hackbod@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en