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

Commit a588850e authored by kunleiz's avatar kunleiz Committed by Steve Kondik
Browse files

audiopolicy: Fix for isStateInCall() do not return proper status

After call disconnected, there is an incoming call again. The
isStateInCall() will return IN_CALL status even the phone is
in RINGTONE status.

This is happening due to incorrect call status select logic in APM.

Fix this by ensuring IN_CALL status selection only when audio mode is
AUDIO_MODE_IN_CALL or AUDIO_MODE_IN_COMMUNICATION.

CRs-Fixed: 855041
Change-Id: I318d098bf1727bd3d9073df9dc163f96e8de7b97
parent 09fade85
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -7045,8 +7045,7 @@ bool AudioPolicyManager::isInCall()
}

bool AudioPolicyManager::isStateInCall(int state) {
    return ((state == AUDIO_MODE_IN_CALL) || (state == AUDIO_MODE_IN_COMMUNICATION) ||
       ((state == AUDIO_MODE_RINGTONE) && (mPrevPhoneState == AUDIO_MODE_IN_CALL)));
    return ((state == AUDIO_MODE_IN_CALL) || (state == AUDIO_MODE_IN_COMMUNICATION));
}

uint32_t AudioPolicyManager::getMaxEffectsCpuLoad()