Android Question [CLOSED] Get the current PhoneWakeState ?

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
Do we have a way to get the current WakeState not to release it by chance if any other app is relying on it ?
Many thanks for that
 

udg

Expert
Licensed User
Longtime User
Never used wake locks before, but maybe you could set an intent in your Manifest so to have a service in your app called when a wake lock is set by some other app.
I didn't see any "check wake state" functions in Android PowerManager.

udg
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Thanks udg. But as the Phone library is able to return if the changed state was already held or not, I guess we should be able to read the current state. BTW thanks for having pointed me to the PowerManager. I'll do some more searches.
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Excuse, I don't get it : if the Phone library is able to tell us that the wanted state was already acquired can't we get the value before to modify it ?
Sorry for the newbie question because I don't have a "understanding" of the question.
 
Upvote 0
Top