Fix comparison of device source bits.
Bug: 6576743
Change-Id: I6952b052e2ab9e62ddd46ab76f4df37ecc656757
diff --git a/services/java/com/android/server/input/InputManagerService.java b/services/java/com/android/server/input/InputManagerService.java
index d85facc..bdd0aa4 100644
--- a/services/java/com/android/server/input/InputManagerService.java
+++ b/services/java/com/android/server/input/InputManagerService.java
@@ -592,7 +592,7 @@
deviceIdAndGeneration[i * 2] = inputDevice.getId();
deviceIdAndGeneration[i * 2 + 1] = inputDevice.getGeneration();
- if (isFullKeyboard(inputDevice)) {
+ if (!inputDevice.isVirtual() && inputDevice.isFullKeyboard()) {
if (!containsInputDeviceWithDescriptor(oldInputDevices,
inputDevice.getDescriptor())) {
mTempFullKeyboards.add(numFullKeyboardsAdded++, inputDevice);
@@ -695,12 +695,6 @@
reloadKeyboardLayouts();
}
- private static boolean isFullKeyboard(InputDevice inputDevice) {
- return !inputDevice.isVirtual()
- && (inputDevice.getSources() & InputDevice.SOURCE_KEYBOARD) != 0
- && inputDevice.getKeyboardType() == InputDevice.KEYBOARD_TYPE_ALPHABETIC;
- }
-
private static boolean containsInputDeviceWithDescriptor(InputDevice[] inputDevices,
String descriptor) {
final int numDevices = inputDevices.length;