开发者

Does PowerManager.PARTIAL_WAKE_LOCK have timeout?

开发者 https://www.devze.com 2023-02-08 10:39 出处:网络
I just use PowerManager.PARTIAL_WAKE_LOCK to let my app still run when users press the power button. My app need to use wifi sensor sometimes so I need to continually register Receiver for wifi sensor

I just use PowerManager.PARTIAL_WAKE_LOCK to let my app still run when users press the power button. My app need to use wifi sensor sometimes so I need to continually register Receiver for wifi sensor and startscan wifimanager, but I find that when system work for a period of time (about 1-2 hours), it seem register Receiver or startscan do not work开发者_如何学运维 successfully. Does anybody have some ideas what's the problem of it or does PowerManager.PARTIAL_WAKE_LOCK have timeout that cause it not work? If does, how to set it?

BTW, is DEIVCE_POWER permission useful to PowerManager or to my app? Can anybody tell me what is it used for?

Thanks a lot!!!

0

精彩评论

暂无评论...
验证码 换一张
取 消