发现在android O上怎么打开不了音量键唤醒,于是看了源代码,
发现KEYCODE_WAKEUP等按键是在interceptKeyBeforeQueueing的最后面的按键唤醒的,于是跟踪代码将需求的按键也修改成iswakeup按键
if (isWakeKey) {
Log.d(TAG, "6380 wake zhongyukang." + keyCode);
wakeUp(event.getEventTime(), mAllowTheaterModeWakeFromKey, "android.policy:KEY");
}
return result;
}
android\frameworks\base\core\java\android\view\KeyEvent.java
frameworks\base\services\core\java\com\android\server\policy\PhoneWindowManager.java