开发者

How to prevent volume keys and camera key from waking up phone in Android?

开发者 https://www.devze.com 2023-01-02 10:46 出处:网络
I have an activity that I want to show up when the phone goes to sleep. However, the phone wakes 开发者_开发问答up when I press the volume buttons or the camera button.

I have an activity that I want to show up when the phone goes to sleep. However, the phone wakes 开发者_开发问答up when I press the volume buttons or the camera button.

I tried using the dispatchKeyEvent(KeyEvent event) method, but it doesn't prevent the phone from waking up.

How else can I disable that functionality?

Thanks,


I heard that waking behaviour is defined on framework level - in policy.jar or somewhere else. So your issue will require modifying system itself. Check also http://forum.samdroid.net/f42/disable-every-button-wake-up-2124/

0

精彩评论

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

关注公众号