From 5bbd4b4f5fc19302fa017ad6afee6eb2d489d91a Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Fri, 20 Apr 2012 19:28:00 -0700 Subject: 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 --- libs/androidfw/InputDevice.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'libs/androidfw/InputDevice.cpp') 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; -- cgit v1.2.3-59-g8ed1b