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
diff --git a/libs/androidfw/InputDevice.cpp b/libs/androidfw/InputDevice.cpp
index d6c49f7..5237063 100644
--- a/libs/androidfw/InputDevice.cpp
+++ b/libs/androidfw/InputDevice.cpp
@@ -127,12 +127,11 @@
 // --- 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 @@
 }
 
 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;