summaryrefslogtreecommitdiff
path: root/libs/androidfw/InputDevice.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2012-04-20 19:28:00 -0700
committer Jeff Brown <jeffbrown@google.com> 2012-04-20 20:11:12 -0700
commit5bbd4b4f5fc19302fa017ad6afee6eb2d489d91a (patch)
tree2bc118a5ef332003cc7f6791968076c48b3cf84b /libs/androidfw/InputDevice.cpp
parent9e6d4b035d4f012d23264d3d2bc946b1ca02dba1 (diff)
Get alias for Bluetooth devices.
Bluetooth devices can be renamed by the user. Make the input system aware of the user-specified name and transparently pass it down to applications. This enables the keyboard layout picker Settings UI to use device names that are consistent with what the user set in the Bluetooth UI. Bug: 6363157 Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
Diffstat (limited to 'libs/androidfw/InputDevice.cpp')
-rw-r--r--libs/androidfw/InputDevice.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/libs/androidfw/InputDevice.cpp b/libs/androidfw/InputDevice.cpp
index d6c49f711329..5237063a4e94 100644
--- a/libs/androidfw/InputDevice.cpp
+++ b/libs/androidfw/InputDevice.cpp
@@ -127,12 +127,11 @@ String8 getInputDeviceConfigurationFilePathByName(
// --- InputDeviceInfo ---
InputDeviceInfo::InputDeviceInfo() {
- initialize(-1, -1, String8("uninitialized device info"), String8("unknown"));
+ initialize(-1, -1, InputDeviceIdentifier(), String8());
}
InputDeviceInfo::InputDeviceInfo(const InputDeviceInfo& other) :
- mId(other.mId), mGeneration(other.mGeneration),
- mName(other.mName), mDescriptor(other.mDescriptor),
+ mId(other.mId), mGeneration(other.mGeneration), mIdentifier(other.mIdentifier),
mSources(other.mSources),
mKeyboardType(other.mKeyboardType),
mKeyCharacterMap(other.mKeyCharacterMap),
@@ -144,11 +143,11 @@ InputDeviceInfo::~InputDeviceInfo() {
}
void InputDeviceInfo::initialize(int32_t id, int32_t generation,
- const String8& name, const String8& descriptor) {
+ const InputDeviceIdentifier& identifier, const String8& alias) {
mId = id;
mGeneration = generation;
- mName = name;
- mDescriptor = descriptor;
+ mIdentifier = identifier;
+ mAlias = alias;
mSources = 0;
mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE;
mHasVibrator = false;