diff options
author | Naresh Tanniru <ntanniru@codeaurora.org> | 2019-04-11 15:46:11 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-04-17 03:14:05 -0700 |
commit | fbee5fb2b10701e5880f947cc2a5e1e3372b1552 (patch) | |
tree | c469f77330527a33de795e3dbb84fc2c1752f2ed | |
parent | 5306f554ac15f40d9d3b5c33a44d4e0e787b6cb9 (diff) | |
download | android_vendor_qcom_opensource_audio-fbee5fb2b10701e5880f947cc2a5e1e3372b1552.tar.gz android_vendor_qcom_opensource_audio-fbee5fb2b10701e5880f947cc2a5e1e3372b1552.tar.bz2 android_vendor_qcom_opensource_audio-fbee5fb2b10701e5880f947cc2a5e1e3372b1552.zip |
audiopolicy: align custom APM with AOSP
- Update custom APM for 190404 tag
Change-Id: Icb60d59756e7c64ff30aaf3711457293da16a368
-rwxr-xr-x | policy_hal/AudioPolicyManager.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp index 3885491..cc5747c 100755 --- a/policy_hal/AudioPolicyManager.cpp +++ b/policy_hal/AudioPolicyManager.cpp @@ -184,8 +184,6 @@ status_t AudioPolicyManagerCustom::setDeviceConnectionStateInt(audio_devices_t d broadcastDeviceConnectionState(device, AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE); return INVALID_OPERATION; } - // Propagate device availability to Engine - mEngine->setDeviceConnectionState(device, state); if (deviceType == AUDIO_DEVICE_OUT_AUX_DIGITAL) { chkDpConnAndAllowedForVoice(); } @@ -233,8 +231,6 @@ status_t AudioPolicyManagerCustom::setDeviceConnectionStateInt(audio_devices_t d // Reset active device codec device->setEncodedFormat(AUDIO_FORMAT_DEFAULT); - // Propagate device availability to Engine - mEngine->setDeviceConnectionState(device, state); if (deviceType == AUDIO_DEVICE_OUT_AUX_DIGITAL) { mEngine->setDpConnAndAllowedForVoice(false); } @@ -245,6 +241,9 @@ status_t AudioPolicyManagerCustom::setDeviceConnectionStateInt(audio_devices_t d return BAD_VALUE; } + // Propagate device availability to Engine + setEngineDeviceConnectionState(device, state); + if (!outputs.isEmpty()) { for (size_t i = 0; i < outputs.size(); i++) { sp<SwAudioOutputDescriptor> desc = mOutputs.valueFor(outputs[i]); @@ -369,8 +368,6 @@ status_t AudioPolicyManagerCustom::setDeviceConnectionStateInt(audio_devices_t d return NO_MEMORY; } - // Propagate device availability to Engine - mEngine->setDeviceConnectionState(device, state); } break; // handle input device disconnection @@ -388,8 +385,6 @@ status_t AudioPolicyManagerCustom::setDeviceConnectionStateInt(audio_devices_t d checkInputsForDevice(device, state, inputs); mAvailableInputDevices.remove(device); - // Propagate device availability to Engine - mEngine->setDeviceConnectionState(device, state); } break; default: @@ -397,6 +392,9 @@ status_t AudioPolicyManagerCustom::setDeviceConnectionStateInt(audio_devices_t d return BAD_VALUE; } + // Propagate device availability to Engine + setEngineDeviceConnectionState(device, state); + closeAllInputs(); /*audio policy: fix call volume over USB*/ // As the input device list can impact the output device selection, update @@ -1106,7 +1104,7 @@ status_t AudioPolicyManagerCustom::stopSource(const sp<SwAudioOutputDescriptor>& if (stream == AUDIO_STREAM_ENFORCED_AUDIBLE && mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) { - setStrategyMute(streamToStrategy(AUDIO_STREAM_RING), false, outputDesc); + setStrategyMute(streamToStrategy(AUDIO_STREAM_ALARM), false, outputDesc); } if (followsSameRouting(client->attributes(), attributes_initializer(AUDIO_USAGE_MEDIA))) { @@ -1139,7 +1137,7 @@ status_t AudioPolicyManagerCustom::startSource(const sp<SwAudioOutputDescriptor> if (stream == AUDIO_STREAM_TTS) { ALOGV("\t found BEACON stream"); if (!mTtsOutputAvailable && mOutputs.isAnyOutputActive( - streamToVolumeSource(AUDIO_STREAM_TTS) /*sourceToIgnore*/)) { + toVolumeSource(AUDIO_STREAM_TTS) /*sourceToIgnore*/)) { return INVALID_OPERATION; } else { beaconMuteLatency = handleEventForBeacon(STARTING_BEACON); |