summaryrefslogtreecommitdiff
path: root/libs/androidfw/Input.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2012-04-06 14:51:01 -0700
committer Jeff Brown <jeffbrown@google.com> 2012-04-06 14:57:19 -0700
commite38fdfae9196afd1bdc14c5ec6c12793af1e2550 (patch)
tree54523ccf3fc36a1b50410e2cb6e6d1f7230c40cf /libs/androidfw/Input.cpp
parentdc0dbbd4a005f16624978b95817b33156acac526 (diff)
Add a unique input device descriptor.
The purpose of the input device descriptor is to make it possible to associate persistent settings for each input device, such as the keyboard layout. The descriptor is a hash of the information we have about the device, such as its vendor id, product id, unique id, name, or location. Bug: 6110399 Change-Id: Idb80f946819b3f0dbf4e661bb0a753dbc2b60981
Diffstat (limited to 'libs/androidfw/Input.cpp')
-rw-r--r--libs/androidfw/Input.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/androidfw/Input.cpp b/libs/androidfw/Input.cpp
index da578395500e..2e4b26f88fc5 100644
--- a/libs/androidfw/Input.cpp
+++ b/libs/androidfw/Input.cpp
@@ -1226,21 +1226,24 @@ void VelocityControl::move(nsecs_t eventTime, float* deltaX, float* deltaY) {
// --- InputDeviceInfo ---
InputDeviceInfo::InputDeviceInfo() {
- initialize(-1, String8("uninitialized device info"));
+ initialize(-1, String8("uninitialized device info"), String8("unknown"));
}
InputDeviceInfo::InputDeviceInfo(const InputDeviceInfo& other) :
- mId(other.mId), mName(other.mName), mSources(other.mSources),
+ mId(other.mId), mName(other.mName), mDescriptor(other.mDescriptor),
+ mSources(other.mSources),
mKeyboardType(other.mKeyboardType),
+ mKeyCharacterMapFile(other.mKeyCharacterMapFile),
mMotionRanges(other.mMotionRanges) {
}
InputDeviceInfo::~InputDeviceInfo() {
}
-void InputDeviceInfo::initialize(int32_t id, const String8& name) {
+void InputDeviceInfo::initialize(int32_t id, const String8& name, const String8& descriptor) {
mId = id;
mName = name;
+ mDescriptor = descriptor;
mSources = 0;
mKeyboardType = AINPUT_KEYBOARD_TYPE_NONE;
mMotionRanges.clear();