HDMI dongle 项目, 需屏蔽物理键盘, 实现如下:
frameworks/base/services/java/com/android/server/wm/WindowManagerService.java 中的 computeScreenConfigurationLocked 方法 将hardKeyboardAvailable = false。
// Determine whether a hard keyboard is available and enabled. boolean hardKeyboardAvailable = false;//config.keyboard != Configuration.KEYBOARD_NOKEYS; if (hardKeyboardAvailable != mHardKeyboardAvailable) { mHardKeyboardAvailable = hardKeyboardAvailable; mHardKeyboardEnabled = hardKeyboardAvailable; mH.removeMessages(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE); mH.sendEmptyMessage(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE); }