Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb279600 authored by Ashish Jain's avatar Ashish Jain Committed by Linux Build Service Account
Browse files

audio_policy: Null check for output profile types

- Currently invalidated Deep buffer and offload
tracks are not suspended/closed.
- BT output is not setting profile type. While initiating voice
call, APM closes all opened outputs to fall back to ULL, based
on profile types
- Modify the check to ensure that valid OutputDesc are
suspended/closed.

Change-Id: I6abc2e28c93a6de9922a8ac7b2a81a477b3ea566
parent 4decccae
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state)
        //suspend  PCM (deep-buffer) output & close  compress & direct tracks
        for (size_t i = 0; i < mOutputs.size(); i++) {
            sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i);
            if ( (outputDesc != NULL) || (outputDesc->mProfile != NULL)) {
            if ( (outputDesc == NULL) || (outputDesc->mProfile == NULL)) {
               ALOGD("ouput desc / profile is NULL");
               continue;
            }
@@ -835,7 +835,7 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state)
        //restore PCM (deep-buffer) output after call termination
        for (size_t i = 0; i < mOutputs.size(); i++) {
            sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i);
            if ( (outputDesc != NULL) || (outputDesc->mProfile != NULL)) {
            if ( (outputDesc == NULL) || (outputDesc->mProfile == NULL)) {
               ALOGD("ouput desc / profile is NULL");
               continue;
            }