Fetch country code information from Device sysfs path
HID devices report the country code via sysfs. Need to read it
and pass it and save it as a member variable to InputDevice
In subsequent CLs will use it to auto-detect a layout for PK.
More information in DD: go/pk_auto_layout_detection
Test: atest inputflinger_tests:InputReaderTest
Bug: 242715614
Change-Id: I73ca7518dbee3e563c41024bb3ed41261c8d7846
diff --git a/services/inputflinger/reader/include/InputDevice.h b/services/inputflinger/reader/include/InputDevice.h
index 51872ac..141464f 100644
--- a/services/inputflinger/reader/include/InputDevice.h
+++ b/services/inputflinger/reader/include/InputDevice.h
@@ -158,6 +158,7 @@
int32_t mId;
int32_t mGeneration;
int32_t mControllerNumber;
+ hardware::input::InputDeviceCountryCode mCountryCode;
InputDeviceIdentifier mIdentifier;
std::string mAlias;
ftl::Flags<InputDeviceClass> mClasses;
@@ -311,6 +312,9 @@
}
inline std::vector<TouchVideoFrame> getVideoFrames() { return mEventHub->getVideoFrames(mId); }
+ inline hardware::input::InputDeviceCountryCode getCountryCode() const {
+ return mEventHub->getCountryCode(mId);
+ }
inline int32_t getScanCodeState(int32_t scanCode) const {
return mEventHub->getScanCodeState(mId, scanCode);
}