diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-04-20 19:28:00 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-04-20 20:11:12 -0700 |
commit | 5bbd4b4f5fc19302fa017ad6afee6eb2d489d91a (patch) | |
tree | 2bc118a5ef332003cc7f6791968076c48b3cf84b /include | |
parent | 9e6d4b035d4f012d23264d3d2bc946b1ca02dba1 (diff) | |
download | frameworks_base-5bbd4b4f5fc19302fa017ad6afee6eb2d489d91a.zip frameworks_base-5bbd4b4f5fc19302fa017ad6afee6eb2d489d91a.tar.gz frameworks_base-5bbd4b4f5fc19302fa017ad6afee6eb2d489d91a.tar.bz2 |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/androidfw/InputDevice.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/androidfw/InputDevice.h b/include/androidfw/InputDevice.h index 38203af..d6ecbf0 100644 --- a/include/androidfw/InputDevice.h +++ b/include/androidfw/InputDevice.h @@ -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; |