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
This commit is contained in:
Jeff Brown
2012-04-20 19:28:00 -07:00
parent 9e6d4b035d
commit 5bbd4b4f5f
11 changed files with 127 additions and 30 deletions

View File

@@ -66,13 +66,16 @@ public:
float fuzz;
};
void initialize(int32_t id, int32_t generation,
const String8& name, const String8& descriptor);
void initialize(int32_t id, int32_t generation, const InputDeviceIdentifier& identifier,
const String8& alias);
inline int32_t getId() const { return mId; }
inline int32_t getGeneration() const { return mGeneration; }
inline const String8 getName() const { return mName; }
inline const String8 getDescriptor() const { return mDescriptor; }
inline const InputDeviceIdentifier& getIdentifier() const { return mIdentifier; }
inline const String8& getAlias() const { return mAlias; }
inline const String8& getDisplayName() const {
return mAlias.isEmpty() ? mIdentifier.name : mAlias;
}
inline uint32_t getSources() const { return mSources; }
const MotionRange* getMotionRange(int32_t axis, uint32_t source) const;
@@ -103,8 +106,8 @@ public:
private:
int32_t mId;
int32_t mGeneration;
String8 mName;
String8 mDescriptor;
InputDeviceIdentifier mIdentifier;
String8 mAlias;
uint32_t mSources;
int32_t mKeyboardType;
sp<KeyCharacterMap> mKeyCharacterMap;