diff options
author | Eric Laurent <elaurent@google.com> | 2015-05-06 18:44:02 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-05-06 18:44:02 -0700 |
commit | 7288ab87a7aa730ffe97d7dc7e118123107bfcea (patch) | |
tree | c12aa50cbf887e27579bdf4bb79d170f51dcebf1 /services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h | |
parent | 464c7e085b68dd63ce8cdbb2c389d3827f8d586a (diff) | |
download | frameworks_av-7288ab87a7aa730ffe97d7dc7e118123107bfcea.zip frameworks_av-7288ab87a7aa730ffe97d7dc7e118123107bfcea.tar.gz frameworks_av-7288ab87a7aa730ffe97d7dc7e118123107bfcea.tar.bz2 |
audio policy: clarify use of mName field for audio devices
The audio port field mName was used for two different purposes
which caused a problem when exposing this information at the SDK API.
Create a new "mTag" field storing the audio_policy.conf device tag
if needed.
Field "mName" is now used to store any additional name associated to
a given device when available (e.g Manufacturer and model name for a USB device).
Change-Id: I17fa872e4a3a2e1b7cbb807c6f72e095a8a2c9c5
Diffstat (limited to 'services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h')
-rw-r--r-- | services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h b/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h index aa37eec..d1a2f4f 100644 --- a/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h +++ b/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h @@ -29,7 +29,7 @@ namespace android { class DeviceDescriptor : public AudioPort, public AudioPortConfig { public: - DeviceDescriptor(const String8& name, audio_devices_t type); + DeviceDescriptor(audio_devices_t type); virtual ~DeviceDescriptor() {} @@ -50,10 +50,9 @@ public: status_t dump(int fd, int spaces, int index) const; void log() const; + String8 mTag; String8 mAddress; - static String8 emptyNameStr; - private: audio_devices_t mDeviceType; audio_port_handle_t mId; @@ -73,12 +72,12 @@ public: audio_devices_t types() const { return mDeviceTypes; } void loadDevicesFromType(audio_devices_t types); - void loadDevicesFromName(char *name, const DeviceVector& declaredDevices); + void loadDevicesFromTag(char *tag, const DeviceVector& declaredDevices); sp<DeviceDescriptor> getDevice(audio_devices_t type, String8 address) const; DeviceVector getDevicesFromType(audio_devices_t types) const; sp<DeviceDescriptor> getDeviceFromId(audio_port_handle_t id) const; - sp<DeviceDescriptor> getDeviceFromName(const String8& name) const; + sp<DeviceDescriptor> getDeviceFromTag(const String8& tag) const; DeviceVector getDevicesFromTypeAddr(audio_devices_t type, String8 address) const; audio_devices_t getDevicesFromHwModule(audio_module_handle_t moduleHandle) const; |