Skip to content
Permalink
Browse files

policy_hal: Adapt to AudioMix API changes in f/av audiopolicy

* LineageOS/android_frameworks_av@97fa326 removes raw pointer
  references to AudioMix. Update our policy HAL to be compatible
  with the new API.

Change-Id: I0d2758dc3f3d068f78d3615285e0117ca562a922
  • Loading branch information...
haggertk committed Aug 6, 2019
1 parent 10da32c commit acf624493aae07a82ff17723e85a8fdbfc4c3166
Showing with 7 additions and 6 deletions.
  1. +7 −6 policy_hal/AudioPolicyManager.cpp
@@ -2237,10 +2237,11 @@ status_t AudioPolicyManagerCustom::startInput(audio_io_handle_t input,
}

if (inputDesc->getAudioSessionCount(true/*activeOnly*/) == 1) {
sp<AudioPolicyMix> policyMix = inputDesc->mPolicyMix.promote();
// if input maps to a dynamic policy with an activity listener, notify of state change
if ((inputDesc->mPolicyMix != NULL)
&& ((inputDesc->mPolicyMix->mCbFlags & AudioMix::kCbFlagNotifyActivity) != 0)) {
mpClientInterface->onDynamicPolicyMixStateUpdate(inputDesc->mPolicyMix->mDeviceAddress,
if ((policyMix != NULL)
&& ((policyMix->mCbFlags & AudioMix::kCbFlagNotifyActivity) != 0)) {
mpClientInterface->onDynamicPolicyMixStateUpdate(policyMix->mDeviceAddress,
MIX_STATE_MIXING);
}

@@ -2259,10 +2260,10 @@ status_t AudioPolicyManagerCustom::startInput(audio_io_handle_t input,
// For remote submix (a virtual device), we open only one input per capture request.
if (audio_is_remote_submix_device(inputDesc->mDevice)) {
String8 address = String8("");
if (inputDesc->mPolicyMix == NULL) {
if (policyMix == NULL) {
address = String8("0");
} else if (inputDesc->mPolicyMix->mMixType == MIX_TYPE_PLAYERS) {
address = inputDesc->mPolicyMix->mDeviceAddress;
} else if (policyMix->mMixType == MIX_TYPE_PLAYERS) {
address = policyMix->mDeviceAddress;
}
if (address != "") {
setDeviceConnectionStateInt(AUDIO_DEVICE_OUT_REMOTE_SUBMIX,

0 comments on commit acf6244

Please sign in to comment.
You can’t perform that action at this time.