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

Commit b83cc19f authored by Thomas Stuart's avatar Thomas Stuart
Browse files

prohibit toggling setAudioModeIsVoip(false) for SM connection

For context, there was a report of a VoIP app experiencing audio
issues in call when switching between a self-managed and PSTN call.
The root cause was from calling setAudioModeIsVoip(false)
on a self-managed connection.

To prevent misuse of the API, prevent toggling of
setAudioModeIsVoIP(false) on a self-managed connection.

Additionally, 2 CTS tests and 1 CtsVerifier test are put in place to
assert there isnt manipulation of this API.

Test: 2 cts,
      1 CtsVerifier called "Telecom Call Audio test"

bug: 236018173

Change-Id: I9161f9369f7bb37c1c2e3f9342e63693cb4f10cc
parent 70c84d90
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2763,6 +2763,12 @@ public abstract class Connection extends Conferenceable {
     * @param isVoip True if the audio mode is VOIP.
     */
    public final void setAudioModeIsVoip(boolean isVoip) {
        if (!isVoip && (mConnectionProperties & PROPERTY_SELF_MANAGED) == PROPERTY_SELF_MANAGED) {
            Log.i(this,
                    "setAudioModeIsVoip: Ignored request to set a self-managed connection's"
                            + " audioModeIsVoip to false. Doing so can cause unwanted behavior.");
            return;
        }
        checkImmutable();
        mAudioModeIsVoip = isVoip;
        for (Listener l : mListeners) {