Re: [android-developers] Difference between user-induced screen on and programmatically induced screen on.

2012-04-05 Thread Dianne Hackborn
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

Re: [android-developers] Difference between user-induced screen on and programmatically induced screen on.

2012-04-04 Thread Put_tiMe
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 putt...@gmail.com wrote: I want to handle this intent

Re: [android-developers] Difference between user-induced screen on and programmatically induced screen on.

2012-04-04 Thread Put_tiMe
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

[android-developers] Difference between user-induced screen on and programmatically induced screen on.

2012-04-03 Thread Put_tiMe
Screen-on can be done in two ways: 1. User pressing the power (or home button) 2. Through code: by using power manager - wake lock - with screen-on flag. Either ways, I get a 'Intent.ACTION_SCREEN_ON' intent. Is there anyway I can distinguish between the two intents? ** ** -- You

Re: [android-developers] Difference between user-induced screen on and programmatically induced screen on.

2012-04-03 Thread TreKing
On Tue, Apr 3, 2012 at 2:29 AM, Put_tiMe putt...@gmail.com wrote: Is there anyway I can distinguish between the two intents? If you explain why you need to distinguish, maybe you'll get a hand in employing a solution to the actual problem you're having.

Re: [android-developers] Difference between user-induced screen on and programmatically induced screen on.

2012-04-03 Thread Put_tiMe
I have registered for SCREEN_ON intent. In the alarm-manager, I grab a wake_lock with *FULL_WAKE_LOCK* flag and that switches on the screen. This sends a SCREEN_ON intent. In the meanwhile, the user could also have switched on the screen. I want to handle this intent in different ways,

Re: [android-developers] Difference between user-induced screen on and programmatically induced screen on.

2012-04-03 Thread TreKing
On Tue, Apr 3, 2012 at 4:21 AM, Put_tiMe putt...@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