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

Commit 1fd15d38 authored by Naresh Tanniru's avatar Naresh Tanniru
Browse files

policy_hal: Null check for output profile types

- Voice call with BT fails

- 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

- Added null check for profile type for different outputs

Change-Id: Ib577d7fade7f42a0b56ee1f59dc6472ca780f502
parent 87f0102b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1677,6 +1677,10 @@ void AudioPolicyManager::setPhoneState(int state)
        //suspend  PCM (deep-buffer) output & close  compress & direct tracks
        for (size_t i = 0; i < mOutputs.size(); i++) {
            AudioOutputDescriptor *outputDesc = mOutputs.valueAt(i);
            if (!outputDesc || !outputDesc->mProfile) {
               ALOGD("ouput desc / profile is NULL");
               continue;
            }
            if (((!outputDesc->isDuplicated() &&outputDesc->mProfile->mFlags & AUDIO_OUTPUT_FLAG_PRIMARY))
                        && prop_playback_enabled) {
                ALOGD(" calling suspendOutput on call mdoe for primary output");
@@ -1701,6 +1705,10 @@ void AudioPolicyManager::setPhoneState(int state)
        //restore PCM (deep-buffer) output after call termination
        for (size_t i = 0; i < mOutputs.size(); i++) {
            AudioOutputDescriptor *outputDesc = mOutputs.valueAt(i);
            if (!outputDesc || !outputDesc->mProfile) {
               ALOGD("ouput desc / profile is NULL");
               continue;
            }
            if (!outputDesc->isDuplicated() &&outputDesc->mProfile->mFlags & AUDIO_OUTPUT_FLAG_PRIMARY) {
                ALOGD("calling restoreOutput after call mode for primary output");
                mpClientInterface->restoreOutput(mOutputs.keyAt(i));