François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "APM::AudioPolicyEngine/PFWWrapper" |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 18 | //#define LOG_NDEBUG 0 |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 19 | |
| 20 | #include "ParameterManagerWrapper.h" |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 21 | #include <ParameterMgrPlatformConnector.h> |
| 22 | #include <SelectionCriterionTypeInterface.h> |
| 23 | #include <SelectionCriterionInterface.h> |
Mikhail Naganov | 913d06c | 2016-11-01 12:49:22 -0700 | [diff] [blame] | 24 | #include <media/convert.h> |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 25 | #include <algorithm> |
| 26 | #include <cutils/config_utils.h> |
| 27 | #include <cutils/misc.h> |
| 28 | #include <fstream> |
| 29 | #include <limits> |
| 30 | #include <sstream> |
| 31 | #include <string> |
| 32 | #include <vector> |
| 33 | #include <stdint.h> |
| 34 | #include <cmath> |
| 35 | #include <utils/Log.h> |
| 36 | |
| 37 | using std::string; |
| 38 | using std::map; |
| 39 | using std::vector; |
| 40 | |
| 41 | /// PFW related definitions |
| 42 | // Logger |
| 43 | class ParameterMgrPlatformConnectorLogger : public CParameterMgrPlatformConnector::ILogger |
| 44 | { |
| 45 | public: |
| 46 | ParameterMgrPlatformConnectorLogger() {} |
| 47 | |
François Gaffie | c1391f9 | 2015-12-10 09:43:48 +0100 | [diff] [blame] | 48 | virtual void info(const string &log) |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 49 | { |
Liu Changcheng | 30cf41f | 2016-12-07 18:58:19 +0800 | [diff] [blame] | 50 | ALOGV("policy-parameter-manager: %s", log.c_str()); |
François Gaffie | c1391f9 | 2015-12-10 09:43:48 +0100 | [diff] [blame] | 51 | } |
| 52 | virtual void warning(const string &log) |
| 53 | { |
| 54 | ALOGW("policy-parameter-manager: %s", log.c_str()); |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 55 | } |
| 56 | }; |
| 57 | |
François Gaffie | f19cf79 | 2018-05-30 17:22:17 +0200 | [diff] [blame] | 58 | namespace android { |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 59 | |
| 60 | using utilities::convertTo; |
| 61 | |
François Gaffie | f19cf79 | 2018-05-30 17:22:17 +0200 | [diff] [blame] | 62 | namespace audio_policy { |
| 63 | |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 64 | const char *const ParameterManagerWrapper::mPolicyPfwDefaultConfFileName = |
| 65 | "/etc/parameter-framework/ParameterFrameworkConfigurationPolicy.xml"; |
Mingwei Shi | c41dc11 | 2017-07-26 10:02:40 +0800 | [diff] [blame] | 66 | const char *const ParameterManagerWrapper::mPolicyPfwVendorConfFileName = |
| 67 | "/vendor/etc/parameter-framework/ParameterFrameworkConfigurationPolicy.xml"; |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 68 | |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 69 | static const char *const gInputDeviceCriterionName = "AvailableInputDevices"; |
| 70 | static const char *const gOutputDeviceCriterionName = "AvailableOutputDevices"; |
| 71 | static const char *const gPhoneStateCriterionName = "TelephonyMode"; |
| 72 | static const char *const gOutputDeviceAddressCriterionName = "AvailableOutputDevicesAddresses"; |
| 73 | static const char *const gInputDeviceAddressCriterionName = "AvailableInputDevicesAddresses"; |
| 74 | |
| 75 | /** |
| 76 | * Order MUST be align with defintiion of audio_policy_force_use_t within audio_policy.h |
| 77 | */ |
| 78 | static const char *const gForceUseCriterionTag[AUDIO_POLICY_FORCE_USE_CNT] = |
| 79 | { |
| 80 | [AUDIO_POLICY_FORCE_FOR_COMMUNICATION] = "ForceUseForCommunication", |
| 81 | [AUDIO_POLICY_FORCE_FOR_MEDIA] = "ForceUseForMedia", |
| 82 | [AUDIO_POLICY_FORCE_FOR_RECORD] = "ForceUseForRecord", |
| 83 | [AUDIO_POLICY_FORCE_FOR_DOCK] = "ForceUseForDock", |
| 84 | [AUDIO_POLICY_FORCE_FOR_SYSTEM] = "ForceUseForSystem", |
| 85 | [AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO] = "ForceUseForHdmiSystemAudio", |
| 86 | [AUDIO_POLICY_FORCE_FOR_ENCODED_SURROUND] = "ForceUseForEncodedSurround", |
| 87 | [AUDIO_POLICY_FORCE_FOR_VIBRATE_RINGING] = "ForceUseForVibrateRinging" |
| 88 | }; |
| 89 | |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 90 | template <> |
| 91 | struct ParameterManagerWrapper::parameterManagerElementSupported<ISelectionCriterionInterface> {}; |
| 92 | template <> |
| 93 | struct ParameterManagerWrapper::parameterManagerElementSupported<ISelectionCriterionTypeInterface> {}; |
| 94 | |
| 95 | ParameterManagerWrapper::ParameterManagerWrapper() |
| 96 | : mPfwConnectorLogger(new ParameterMgrPlatformConnectorLogger) |
| 97 | { |
| 98 | // Connector |
Mingwei Shi | c41dc11 | 2017-07-26 10:02:40 +0800 | [diff] [blame] | 99 | if (access(mPolicyPfwVendorConfFileName, R_OK) == 0) { |
| 100 | mPfwConnector = new CParameterMgrPlatformConnector(mPolicyPfwVendorConfFileName); |
| 101 | } else { |
| 102 | mPfwConnector = new CParameterMgrPlatformConnector(mPolicyPfwDefaultConfFileName); |
| 103 | } |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 104 | |
| 105 | // Logger |
| 106 | mPfwConnector->setLogger(mPfwConnectorLogger); |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 107 | } |
| 108 | |
François Gaffie | 7188f1a | 2018-11-02 14:35:42 +0100 | [diff] [blame] | 109 | status_t ParameterManagerWrapper::addCriterion(const std::string &name, bool isInclusive, |
| 110 | ValuePairs pairs, const std::string &defaultValue) |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 111 | { |
François Gaffie | 7188f1a | 2018-11-02 14:35:42 +0100 | [diff] [blame] | 112 | ALOG_ASSERT(not isStarted(), "Cannot add a criterion if PFW is already started"); |
| 113 | auto criterionType = mPfwConnector->createSelectionCriterionType(isInclusive); |
| 114 | |
| 115 | for (auto pair : pairs) { |
| 116 | std::string error; |
| 117 | ALOGV("%s: Adding pair %d,%s for criterionType %s", __FUNCTION__, pair.first, |
| 118 | pair.second.c_str(), name.c_str()); |
| 119 | criterionType->addValuePair(pair.first, pair.second, error); |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 120 | } |
François Gaffie | 7188f1a | 2018-11-02 14:35:42 +0100 | [diff] [blame] | 121 | ALOG_ASSERT(mPolicyCriteria.find(name) == mPolicyCriteria.end(), |
| 122 | "%s: Criterion %s already added", __FUNCTION__, name.c_str()); |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 123 | |
François Gaffie | 7188f1a | 2018-11-02 14:35:42 +0100 | [diff] [blame] | 124 | auto criterion = mPfwConnector->createSelectionCriterion(name, criterionType); |
| 125 | mPolicyCriteria[name] = criterion; |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 126 | |
François Gaffie | 7188f1a | 2018-11-02 14:35:42 +0100 | [diff] [blame] | 127 | if (not defaultValue.empty()) { |
| 128 | int numericalValue = 0; |
| 129 | if (not criterionType->getNumericalValue(defaultValue.c_str(), numericalValue)) { |
| 130 | ALOGE("%s; trying to apply invalid default literal value (%s)", __FUNCTION__, |
| 131 | defaultValue.c_str()); |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 132 | } |
François Gaffie | 7188f1a | 2018-11-02 14:35:42 +0100 | [diff] [blame] | 133 | criterion->setCriterionState(numericalValue); |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 134 | } |
François Gaffie | 7188f1a | 2018-11-02 14:35:42 +0100 | [diff] [blame] | 135 | return NO_ERROR; |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 136 | } |
| 137 | |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 138 | ParameterManagerWrapper::~ParameterManagerWrapper() |
| 139 | { |
| 140 | // Unset logger |
| 141 | mPfwConnector->setLogger(NULL); |
| 142 | // Remove logger |
| 143 | delete mPfwConnectorLogger; |
| 144 | // Remove connector |
| 145 | delete mPfwConnector; |
| 146 | } |
| 147 | |
| 148 | status_t ParameterManagerWrapper::start() |
| 149 | { |
| 150 | ALOGD("%s: in", __FUNCTION__); |
| 151 | /// Start PFW |
| 152 | std::string error; |
| 153 | if (!mPfwConnector->start(error)) { |
| 154 | ALOGE("%s: Policy PFW start error: %s", __FUNCTION__, error.c_str()); |
| 155 | return NO_INIT; |
| 156 | } |
| 157 | ALOGD("%s: Policy PFW successfully started!", __FUNCTION__); |
| 158 | return NO_ERROR; |
| 159 | } |
| 160 | |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 161 | template <typename T> |
| 162 | T *ParameterManagerWrapper::getElement(const string &name, std::map<string, T *> &elementsMap) |
| 163 | { |
| 164 | parameterManagerElementSupported<T>(); |
| 165 | typename std::map<string, T *>::iterator it = elementsMap.find(name); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 166 | ALOG_ASSERT(it != elementsMap.end(), "Element %s not found", name.c_str()); |
| 167 | return it != elementsMap.end() ? it->second : NULL; |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | template <typename T> |
| 171 | const T *ParameterManagerWrapper::getElement(const string &name, const std::map<string, T *> &elementsMap) const |
| 172 | { |
| 173 | parameterManagerElementSupported<T>(); |
| 174 | typename std::map<string, T *>::const_iterator it = elementsMap.find(name); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 175 | ALOG_ASSERT(it != elementsMap.end(), "Element %s not found", name.c_str()); |
| 176 | return it != elementsMap.end() ? it->second : NULL; |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 177 | } |
| 178 | |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 179 | bool ParameterManagerWrapper::isStarted() |
| 180 | { |
| 181 | return mPfwConnector && mPfwConnector->isStarted(); |
| 182 | } |
| 183 | |
| 184 | status_t ParameterManagerWrapper::setPhoneState(audio_mode_t mode) |
| 185 | { |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 186 | ISelectionCriterionInterface *criterion = |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 187 | getElement<ISelectionCriterionInterface>(gPhoneStateCriterionName, mPolicyCriteria); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 188 | if (criterion == NULL) { |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 189 | ALOGE("%s: no criterion found for %s", __FUNCTION__, gPhoneStateCriterionName); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 190 | return BAD_VALUE; |
| 191 | } |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 192 | if (!isValueValidForCriterion(criterion, static_cast<int>(mode))) { |
| 193 | return BAD_VALUE; |
| 194 | } |
| 195 | criterion->setCriterionState((int)(mode)); |
| 196 | applyPlatformConfiguration(); |
| 197 | return NO_ERROR; |
| 198 | } |
| 199 | |
| 200 | audio_mode_t ParameterManagerWrapper::getPhoneState() const |
| 201 | { |
| 202 | const ISelectionCriterionInterface *criterion = |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 203 | getElement<ISelectionCriterionInterface>(gPhoneStateCriterionName, mPolicyCriteria); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 204 | if (criterion == NULL) { |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 205 | ALOGE("%s: no criterion found for %s", __FUNCTION__, gPhoneStateCriterionName); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 206 | return AUDIO_MODE_NORMAL; |
| 207 | } |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 208 | return static_cast<audio_mode_t>(criterion->getCriterionState()); |
| 209 | } |
| 210 | |
| 211 | status_t ParameterManagerWrapper::setForceUse(audio_policy_force_use_t usage, |
| 212 | audio_policy_forced_cfg_t config) |
| 213 | { |
| 214 | // @todo: return an error on a unsupported value |
| 215 | if (usage > AUDIO_POLICY_FORCE_USE_CNT) { |
| 216 | return BAD_VALUE; |
| 217 | } |
| 218 | |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 219 | ISelectionCriterionInterface *criterion = |
| 220 | getElement<ISelectionCriterionInterface>(gForceUseCriterionTag[usage], mPolicyCriteria); |
| 221 | if (criterion == NULL) { |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 222 | ALOGE("%s: no criterion found for %s", __FUNCTION__, gForceUseCriterionTag[usage]); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 223 | return BAD_VALUE; |
| 224 | } |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 225 | if (!isValueValidForCriterion(criterion, static_cast<int>(config))) { |
| 226 | return BAD_VALUE; |
| 227 | } |
| 228 | criterion->setCriterionState((int)config); |
| 229 | applyPlatformConfiguration(); |
| 230 | return NO_ERROR; |
| 231 | } |
| 232 | |
| 233 | audio_policy_forced_cfg_t ParameterManagerWrapper::getForceUse(audio_policy_force_use_t usage) const |
| 234 | { |
| 235 | // @todo: return an error on a unsupported value |
| 236 | if (usage > AUDIO_POLICY_FORCE_USE_CNT) { |
| 237 | return AUDIO_POLICY_FORCE_NONE; |
| 238 | } |
| 239 | const ISelectionCriterionInterface *criterion = |
| 240 | getElement<ISelectionCriterionInterface>(gForceUseCriterionTag[usage], mPolicyCriteria); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 241 | if (criterion == NULL) { |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 242 | ALOGE("%s: no criterion found for %s", __FUNCTION__, gForceUseCriterionTag[usage]); |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 243 | return AUDIO_POLICY_FORCE_NONE; |
| 244 | } |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 245 | return static_cast<audio_policy_forced_cfg_t>(criterion->getCriterionState()); |
| 246 | } |
| 247 | |
| 248 | bool ParameterManagerWrapper::isValueValidForCriterion(ISelectionCriterionInterface *criterion, |
| 249 | int valueToCheck) |
| 250 | { |
| 251 | const ISelectionCriterionTypeInterface *interface = criterion->getCriterionType(); |
| 252 | string literalValue; |
| 253 | return interface->getLiteralValue(valueToCheck, literalValue); |
| 254 | } |
| 255 | |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 256 | status_t ParameterManagerWrapper::setDeviceConnectionState(const sp<DeviceDescriptor> devDesc, |
| 257 | audio_policy_dev_state_t state) |
| 258 | { |
| 259 | std::string criterionName = audio_is_output_device(devDesc->type()) ? |
| 260 | gOutputDeviceAddressCriterionName : gInputDeviceAddressCriterionName; |
| 261 | |
François Gaffie | dc7553f | 2018-11-02 10:39:57 +0100 | [diff] [blame] | 262 | ALOGV("%s: device with address %s %s", __FUNCTION__, devDesc->address().string(), |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 263 | state != AUDIO_POLICY_DEVICE_STATE_AVAILABLE? "disconnected" : "connected"); |
| 264 | ISelectionCriterionInterface *criterion = |
| 265 | getElement<ISelectionCriterionInterface>(criterionName, mPolicyCriteria); |
| 266 | |
| 267 | if (criterion == NULL) { |
| 268 | ALOGE("%s: no criterion found for %s", __FUNCTION__, criterionName.c_str()); |
| 269 | return DEAD_OBJECT; |
| 270 | } |
| 271 | |
| 272 | auto criterionType = criterion->getCriterionType(); |
| 273 | int deviceAddressId; |
Francois Gaffie | 716e143 | 2019-01-14 16:58:59 +0100 | [diff] [blame] | 274 | if (not criterionType->getNumericalValue(devDesc->address().string(), deviceAddressId)) { |
| 275 | ALOGW("%s: unknown device address reported (%s)", __FUNCTION__, devDesc->address().c_str()); |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 276 | return BAD_TYPE; |
| 277 | } |
| 278 | int currentValueMask = criterion->getCriterionState(); |
| 279 | if (state == AUDIO_POLICY_DEVICE_STATE_AVAILABLE) { |
| 280 | currentValueMask |= deviceAddressId; |
| 281 | } |
| 282 | else { |
| 283 | currentValueMask &= ~deviceAddressId; |
| 284 | } |
| 285 | criterion->setCriterionState(currentValueMask); |
| 286 | return NO_ERROR; |
| 287 | } |
| 288 | |
François Gaffie | a3e696d | 2015-12-18 09:38:43 +0100 | [diff] [blame] | 289 | status_t ParameterManagerWrapper::setAvailableInputDevices(audio_devices_t inputDevices) |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 290 | { |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 291 | ISelectionCriterionInterface *criterion = |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 292 | getElement<ISelectionCriterionInterface>(gInputDeviceCriterionName, mPolicyCriteria); |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 293 | if (criterion == NULL) { |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 294 | ALOGE("%s: no criterion found for %s", __FUNCTION__, gInputDeviceCriterionName); |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 295 | return DEAD_OBJECT; |
| 296 | } |
François Gaffie | a3e696d | 2015-12-18 09:38:43 +0100 | [diff] [blame] | 297 | criterion->setCriterionState(inputDevices & ~AUDIO_DEVICE_BIT_IN); |
| 298 | applyPlatformConfiguration(); |
| 299 | return NO_ERROR; |
| 300 | } |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 301 | |
François Gaffie | a3e696d | 2015-12-18 09:38:43 +0100 | [diff] [blame] | 302 | status_t ParameterManagerWrapper::setAvailableOutputDevices(audio_devices_t outputDevices) |
| 303 | { |
François Gaffie | 814ce80 | 2016-01-18 11:23:47 +0100 | [diff] [blame] | 304 | ISelectionCriterionInterface *criterion = |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 305 | getElement<ISelectionCriterionInterface>(gOutputDeviceCriterionName, mPolicyCriteria); |
François Gaffie | a3e696d | 2015-12-18 09:38:43 +0100 | [diff] [blame] | 306 | if (criterion == NULL) { |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 307 | ALOGE("%s: no criterion found for %s", __FUNCTION__, gOutputDeviceCriterionName); |
François Gaffie | a3e696d | 2015-12-18 09:38:43 +0100 | [diff] [blame] | 308 | return DEAD_OBJECT; |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 309 | } |
François Gaffie | a3e696d | 2015-12-18 09:38:43 +0100 | [diff] [blame] | 310 | criterion->setCriterionState(outputDevices); |
François Gaffie | 20f06f9 | 2015-03-24 09:01:14 +0100 | [diff] [blame] | 311 | applyPlatformConfiguration(); |
| 312 | return NO_ERROR; |
| 313 | } |
| 314 | |
| 315 | void ParameterManagerWrapper::applyPlatformConfiguration() |
| 316 | { |
| 317 | mPfwConnector->applyConfigurations(); |
| 318 | } |
| 319 | |
| 320 | } // namespace audio_policy |
| 321 | } // namespace android |