Skip to content

Commit 4ebdd11

Browse files
committedAug 7, 2019
msm8998: policy_hal: Adapt to AudioMix API changes in f/av audiopolicy
* Ic508caedefe721ed7e7ba6ee3e9175ba9e8dc23a removes raw pointer references to AudioMix. Update our policy HAL to be compatible with the new API. Change-Id: I0d2758dc3f3d068f78d3615285e0117ca562a922
1 parent cc24d96 commit 4ebdd11

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎policy_hal/AudioPolicyManager.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -2174,10 +2174,11 @@ status_t AudioPolicyManagerCustom::startInput(audio_io_handle_t input,
21742174
setInputDevice(input, device, true /* force */);
21752175

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

@@ -2192,10 +2193,10 @@ status_t AudioPolicyManagerCustom::startInput(audio_io_handle_t input,
21922193
// For remote submix (a virtual device), we open only one input per capture request.
21932194
if (audio_is_remote_submix_device(inputDesc->mDevice)) {
21942195
String8 address = String8("");
2195-
if (inputDesc->mPolicyMix == NULL) {
2196+
if (policyMix == NULL) {
21962197
address = String8("0");
2197-
} else if (inputDesc->mPolicyMix->mMixType == MIX_TYPE_PLAYERS) {
2198-
address = inputDesc->mPolicyMix->mDeviceAddress;
2198+
} else if (policyMix->mMixType == MIX_TYPE_PLAYERS) {
2199+
address = policyMix->mDeviceAddress;
21992200
}
22002201
if (address != "") {
22012202
setDeviceConnectionStateInt(AUDIO_DEVICE_OUT_REMOTE_SUBMIX,

0 commit comments

Comments
 (0)
Please sign in to comment.