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 <[email protected]> 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-on is initiated from Alarm-manager.
>
>
>
> On Wednesday, April 4, 2012 12:26:49 PM UTC+5:30, Put_tiMe wrote:
>
>> If it's a code induced screen-on, I want to switch bluetooth 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 <[email protected]> wrote:
>>>
>>>> I want to handle this intent in different ways, depending on where it
>>>> originated from.
>>>
>>>
>>> You still didn't explain *why*.
>>>
>>> ------------------------------**------------------------------**
>>> ------------------------------**-------
>>> TreKing <http://sites.google.com/site/rezmobileapps/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 [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
>



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