Gets keyboard layout info from user space when available.
The layout info consists of a BCP 47 conformant language tag and a
layout type such as "qwerty" or "azerty". They will be used to
initialize the input device.
This is currently used by uinput virtual keyboard to pass in layout
information.
Bug: 237537306
Test: atest inputflinger_tests
Change-Id: Icfc30f1afb0f88dd704d1d598d62a300a032b0f5
diff --git a/services/inputflinger/reader/include/InputDevice.h b/services/inputflinger/reader/include/InputDevice.h
index af59fe2..6179f05 100644
--- a/services/inputflinger/reader/include/InputDevice.h
+++ b/services/inputflinger/reader/include/InputDevice.h
@@ -54,6 +54,7 @@
inline std::optional<std::string> getBluetoothAddress() const {
return mIdentifier.bluetoothAddress;
}
+ inline const std::string getLocation() const { return mIdentifier.location; }
inline ftl::Flags<InputDeviceClass> getClasses() const { return mClasses; }
inline uint32_t getSources() const { return mSources; }
inline bool hasEventHubDevices() const { return !mDevices.empty(); }
@@ -405,6 +406,7 @@
inline const std::string getName() { return mDevice.getName(); }
inline const std::string getDescriptor() { return mDevice.getDescriptor(); }
+ inline const std::string getLocation() { return mDevice.getLocation(); }
inline bool isExternal() { return mDevice.isExternal(); }
inline std::optional<uint8_t> getAssociatedDisplayPort() const {
return mDevice.getAssociatedDisplayPort();