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;
android 10 系统源码 配置按键唤醒屏幕
最新推荐文章于 2023-03-22 18:53:50 发布