From e38fdfae9196afd1bdc14c5ec6c12793af1e2550 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Fri, 6 Apr 2012 14:51:01 -0700 Subject: 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 --- libs/androidfw/Input.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libs/androidfw/Input.cpp') 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(); -- cgit v1.2.3-59-g8ed1b