Get notified when some other application acquires wake lock

Posted by Sebouh on Stack Overflow See other posts from Stack Overflow or by Sebouh
Published on 2012-01-06T20:09:20Z Indexed on 2012/04/05 5:29 UTC
Read the original article Hit count: 137

Filed under:
|
|
|
|

I am wondering if the following is possible in android. I want to have my application do a certain task whenever the phone get awoken. Whenever some other application acquires a wake lock to do it's task, I want my application to do something of its own.

Can I get notified through an intent using a broadcast receiver about this event? If so, what will happen if that other application finishes before my task ends?

The reason I'm asking is that I don't want to wake the phone up to do my task and affect the battery life. I want to take the opportunity of the wake lock to do my thing.

© Stack Overflow or respective owner

Related posts about android

Related posts about broadcast