第一种方式:(两种方式采用一种即可)
frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java line 2790
//if (SystemProperties.get(“ro.mtk_hw_key_remapping”).equals(“1”)) { //将该行注释掉
// Check keys
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
// Ignore these keyes, handled when queuing
return -1;
}
// } //将改行注释掉
第二种方式:
frameworks/base/core/java/com/android/internal/policy/PhoneWindow.java
找到 onKeyDown 函数,直接将 line1861
添加返回 return true;
case KeyEvent.KEYCODE_VOLUME_UP:
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
return true;