android 10 系统源码 配置按键唤醒屏幕

frameworks/base/core/java/android/view/KeyEvent.java

	/** @hide */
    public static final boolean isWakeKey(int keyCode) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_BACK:
            case KeyEvent.KEYCODE_MENU:
            case KeyEvent.KEYCODE_WAKEUP:
            case KeyEvent.KEYCODE_PAIRING:
            case KeyEvent.KEYCODE_STEM_1:
            case KeyEvent.KEYCODE_STEM_2:
            case KeyEvent.KEYCODE_STEM_3:
+           case KeyEvent.KEYCODE_VOLUME_DOWN:
+           case KeyEvent.KEYCODE_VOLUME_UP:
+           case KeyEvent.KEYCODE_HOME:
            case KeyEvent.KEYCODE_SMARTKEY:
            case KeyEvent.KEYCODE_SPEECHH:
            case KeyEvent.KEYCODE_LCDCLICK:
            case KeyEvent.KEYCODE_EPDCLICK:
                return true;
        }
        return false;
    }

frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
// 音量加减键需要注释以下代码
@@ -4197,8 +4197,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     private boolean isWakeKeyWhenScreenOff(int keyCode) {
         switch (keyCode) {
             // ignore volume keys unless docked
-            case KeyEvent.KEYCODE_VOLUME_UP:
-            case KeyEvent.KEYCODE_VOLUME_DOWN:
+            /*case KeyEvent.KEYCODE_VOLUME_UP:
+             case KeyEvent.KEYCODE_VOLUME_DOWN:*/
             case KeyEvent.KEYCODE_VOLUME_MUTE:
                 return mDefaultDisplayPolicy.getDockMode() != Intent.EXTRA_DOCK_STATE_UNDOCKED;
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值