Getting an event when the device wakes up?

439 views
Skip to first unread message

hippoma...@gmail.com

unread,
Feb 27, 2014, 5:32:17 PM2/27/14
to tas...@googlegroups.com
Is there any Tasker event that gets triggered when my device wakes up after falling asleep?

If not, have any of you figured out a way to detect this case?

Thank you in advance.
.

Matt R

unread,
Feb 27, 2014, 10:46:52 PM2/27/14
to tas...@googlegroups.com
Do you mean screen on?

Matt

hippoma...@gmail.com

unread,
Mar 9, 2014, 4:28:36 PM3/9/14
to tas...@googlegroups.com
On Thursday, February 27, 2014 10:46:52 PM UTC-5, Matt R wrote:
Do you mean screen on?

Matt


I guess so. So is "screen on" always equivalent to "device awake" and "screen off" always equivalent to "device asleep", or are there subtle differences between these?

Judging from your comment, I would guess that there are no differences, but I just want to confirm.

Thank you very much.

Matt R

unread,
Mar 9, 2014, 5:53:00 PM3/9/14
to tas...@googlegroups.com
What do you mean awake/asleep? Like the CPU?

Matt

hippoma...@gmail.com

unread,
Mar 9, 2014, 6:04:34 PM3/9/14
to tas...@googlegroups.com
I'm referring to what is commonly called "Device going to sleep" and "Device waking up" in the Android world. Unfortunately, I'm not sure exactly what occurs at the CPU and OS levels when Android "goes to sleep".

For example, within Android settings, there is an attribute called "Sleep" which we can set to the number of seconds or minutes of inactivity that elapse before the device "goes to sleep" -- whatever that means besides simply turning off the screen.

This is the "going to sleep" that I'm referring to. I assume it runs the OS at some lower level of activity with the screen turned off. However, what I'm confused about is whether turning off the screen always results in the system "going to sleep" and vice versa, or whether there are ways to turn off the screen that don't involve running the OS at a lower level of activity.

Thank you.
.

Bob Hansen

unread,
Mar 9, 2014, 6:24:50 PM3/9/14
to tas...@googlegroups.com
>...I'm confused about is whether turning off the screen always results in the system "going to sleep" and vice versa, or whether there are ways to turn off the screen that don't involve running the OS at a lower level of activity.

Turning off the screen does not necessarily mean the device will go to sleep. For example, if your using an audio player and the screen is off the device is not going to go to sleep because the audio player will have a wakelock on which will keep the device from going to sleep. 

When the device goes to sleep, it does whatever can be done based on the hardware to minimize battery usage. That includes shutting down GPS, mobile data, wifi, radios and slowing or stopping the cpu. The device will be awakened by hardware signals associated with buttons or hardware timers and other hardware signals. The whole point is to conserve battery.

hippoma...@gmail.com

unread,
Mar 9, 2014, 6:36:50 PM3/9/14
to tas...@googlegroups.com
On Sunday, March 9, 2014 6:24:50 PM UTC-4, Bob Hansen wrote:
... Turning off the screen does not necessarily mean the device will go to sleep. For example, if your using an audio player and the screen is off the device is not going to go to sleep because the audio player will have a wakelock on which will keep the device from going to sleep. ...

Thank you very much. So do the "Display Off" and "Display On" Tasker events get triggered in the case you mentioned ... screen off/on during audio playing? If so, then Display Off/On can occur during cases other than device sleep and wake-up.

And in this case, is there a way in Tasker to detect the device going to sleep and waking up, irrespective of the state of the display? This question is the reason for my starting this thread.
.

Bob Hansen

unread,
Mar 9, 2014, 7:22:48 PM3/9/14
to tas...@googlegroups.com
>If so, then Display Off/On can occur during cases other than device sleep and wake-up.
Yes

>And in this case, is there a way in Tasker to detect the device going to sleep and waking up, irrespective of the state of the display?
No.
If you tried to have Tasker react to some message about the device going to sleep Tasker's activity would stop it from going to sleep. If the device is sleeping then Tasker can't react to anything. 

hippoma...@gmail.com

unread,
Mar 9, 2014, 7:46:38 PM3/9/14
to tas...@googlegroups.com
On Sunday, March 9, 2014 7:22:48 PM UTC-4, Bob Hansen wrote:
If you tried to have Tasker react to some message about the device going to sleep Tasker's activity would stop it from going to sleep. If the device is sleeping then Tasker can't react to anything. 

I should have been more clear in what I wrote: is there a way for Tasker to know when the device wakes up ... irrespective of the state of the display?

I'm guessing that the answer is still no, given what you wrote above, but I just want to make sure.

Thank you.
.

Bob Hansen

unread,
Mar 9, 2014, 9:04:28 PM3/9/14
to tas...@googlegroups.com
Not that I am aware of.

hippoma...@gmail.com

unread,
Mar 9, 2014, 10:57:50 PM3/9/14
to tas...@googlegroups.com
On Sunday, March 9, 2014 9:04:28 PM UTC-4, Bob Hansen wrote:
Not that I am aware of.

OK. Thank you very much.
 
Reply all
Reply to author
Forward
0 new messages