summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/common
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2015-03-31 18:02:24 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2015-04-01 11:29:43 -0700
commit887a9ed4446cb451181c392a0e51a69914e58fbf (patch)
tree148916028dcdf5c2db173f62f1b063412d070124 /services/audiopolicy/common
parent2110e04cdfbf9ad85ce154ce5f778ee5ccfc95eb (diff)
downloadframeworks_av-887a9ed4446cb451181c392a0e51a69914e58fbf.zip
frameworks_av-887a9ed4446cb451181c392a0e51a69914e58fbf.tar.gz
frameworks_av-887a9ed4446cb451181c392a0e51a69914e58fbf.tar.bz2
Updates to AudioPolicyManager refactor
Use protected access in AudioPolicyManager class for - engine field - querying phone state - isStrategyActive Fix inclusion of AudioPolicyManagerInterface header. Use "APM_" prefix in audio policy conf parsing code to avoid naming conflicts with some HALs. DeviceDescriptor and its collection class are good friends now. Change-Id: I236d62a2b8a4b6bf68dd515932650b912577c145
Diffstat (limited to 'services/audiopolicy/common')
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h2
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/audio_policy_conf.h7
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/HwModule.cpp4
3 files changed, 8 insertions, 5 deletions
diff --git a/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h b/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h
index b9e1d4a..d15f6b4 100644
--- a/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h
+++ b/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h
@@ -54,6 +54,8 @@ public:
private:
audio_devices_t mDeviceType;
+
+friend class DeviceVector;
};
class DeviceVector : public SortedVector< sp<DeviceDescriptor> >
diff --git a/services/audiopolicy/common/managerdefinitions/include/audio_policy_conf.h b/services/audiopolicy/common/managerdefinitions/include/audio_policy_conf.h
index 441bf7b..a393e3b 100644
--- a/services/audiopolicy/common/managerdefinitions/include/audio_policy_conf.h
+++ b/services/audiopolicy/common/managerdefinitions/include/audio_policy_conf.h
@@ -16,6 +16,7 @@
#pragma once
+
/////////////////////////////////////////////////
// Definitions for audio policy configuration file (audio_policy.conf)
/////////////////////////////////////////////////
@@ -50,9 +51,9 @@
// "formats" in outputs descriptors indicating that supported
// values should be queried after opening the output.
-#define DEVICES_TAG "devices"
-#define DEVICE_TYPE "type"
-#define DEVICE_ADDRESS "address"
+#define APM_DEVICES_TAG "devices"
+#define APM_DEVICE_TYPE "type"
+#define APM_DEVICE_ADDRESS "address"
#define MIXERS_TAG "mixers"
#define MIXER_TYPE "type"
diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
index 8004303..0097d69 100644
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
@@ -142,7 +142,7 @@ status_t HwModule::loadDevice(cnode *root)
audio_devices_t type = AUDIO_DEVICE_NONE;
while (node) {
- if (strcmp(node->name, DEVICE_TYPE) == 0) {
+ if (strcmp(node->name, APM_DEVICE_TYPE) == 0) {
type = ConfigParsingUtils::parseDeviceNames((char *)node->value);
break;
}
@@ -158,7 +158,7 @@ status_t HwModule::loadDevice(cnode *root)
node = root->first_child;
while (node) {
- if (strcmp(node->name, DEVICE_ADDRESS) == 0) {
+ if (strcmp(node->name, APM_DEVICE_ADDRESS) == 0) {
deviceDesc->mAddress = String8((char *)node->value);
} else if (strcmp(node->name, CHANNELS_TAG) == 0) {
if (audio_is_input_device(type)) {