summaryrefslogtreecommitdiff
path: root/include/input/InputDevice.h
diff options
context:
space:
mode:
author Vaibhav Devmurari <vdevmurari@google.com> 2023-04-11 18:53:04 +0000
committer Vaibhav Devmurari <vdevmurari@google.com> 2023-04-20 20:34:07 +0000
commit0a6fee80fbda45cd72a8e75948e0925798064648 (patch)
treeb575e2e824a623635a1bdb18cb742bf71a0330b0 /include/input/InputDevice.h
parent6050892386175a21941b5bd8814983e2509ecbb7 (diff)
Force input device changed callback when Keyboard layout info is updated
Virtual keyboard creation uses KEYBOARD_LAYOUT_ASSOCIATION reconfig to associated input device with keyboard layout info. But this can happen after input device added (Race condition between device creation and input device added callback.) If input device already added then we sometimes don't get input device changed callback since the generation is same. Test: atest VirtualKeyboardLayoutTest Bug: 277778640 Change-Id: I218b6d797da27ec3a383fbcd2ebeacb0afbf5fab
Diffstat (limited to 'include/input/InputDevice.h')
-rw-r--r--include/input/InputDevice.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h
index 66d3435907..1a40fdb90c 100644
--- a/include/input/InputDevice.h
+++ b/include/input/InputDevice.h
@@ -212,6 +212,11 @@ struct KeyboardLayoutInfo {
std::string languageTag;
// The layout type such as QWERTY or AZERTY.
std::string layoutType;
+
+ inline bool operator==(const KeyboardLayoutInfo& other) const {
+ return languageTag == other.languageTag && layoutType == other.layoutType;
+ }
+ inline bool operator!=(const KeyboardLayoutInfo& other) const { return !(*this == other); }
};
// The version of the Universal Stylus Initiative (USI) protocol supported by the input device.