Convert country code to Layoutinfo (Language tag + Layout type)
Instead of passing country code to InputDevice.java, convert it
to Language tag and Layout type on native side and pass that
forward instead.
We can later add support for HID language tag, that would give
us better layout information than country code. This HID
language tag is for Keyboard devices so, we set this country
code derived language tag also for Keyboards only, even though
country code could be specified for all types of devices.
Moreover, we are using language tag and layout type for setting
layout related info for Virtual keyboard devices too, making
using country code redundant.
Test: atest inputflinger_tests
Bug: 259530132
Change-Id: I8eca5537a5bb44d0b8b056947cc317ac82a0901f
diff --git a/libs/input/InputDevice.cpp b/libs/input/InputDevice.cpp
index fb6c590..87333f2 100644
--- a/libs/input/InputDevice.cpp
+++ b/libs/input/InputDevice.cpp
@@ -26,7 +26,6 @@
#include <input/InputEventLabels.h>
using android::base::StringPrintf;
-using android::hardware::input::InputDeviceCountryCode;
namespace android {
@@ -178,7 +177,6 @@
mAlias(other.mAlias),
mIsExternal(other.mIsExternal),
mHasMic(other.mHasMic),
- mCountryCode(other.mCountryCode),
mKeyboardLayoutInfo(other.mKeyboardLayoutInfo),
mSources(other.mSources),
mKeyboardType(other.mKeyboardType),
@@ -197,7 +195,7 @@
void InputDeviceInfo::initialize(int32_t id, int32_t generation, int32_t controllerNumber,
const InputDeviceIdentifier& identifier, const std::string& alias,
- bool isExternal, bool hasMic, InputDeviceCountryCode countryCode) {
+ bool isExternal, bool hasMic) {
mId = id;
mGeneration = generation;
mControllerNumber = controllerNumber;
@@ -205,7 +203,6 @@
mAlias = alias;
mIsExternal = isExternal;
mHasMic = hasMic;
- mCountryCode = countryCode;
mSources = 0;
mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE;
mHasVibrator = false;