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

Commit c6e763fa authored by Jimmy Wu's avatar Jimmy Wu
Browse files

Add voip audio mode configuration for ims call

Add mAudioModeIsVoip in Connection. Set it to true for
ImsPhoneConnection if config_use_voip_mode_for_ims is enabled.

Change-Id: Id4ef172deab636c79e749e8d1acb90fabdbcd4eb
parent bd9734a4
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ public abstract class Connection {
    private int mVideoState;
    private int mConnectionCapabilities;
    private boolean mIsWifi;
    private boolean mAudioModeIsVoip;
    private int mAudioQuality;
    private int mCallSubstate;
    private android.telecom.Connection.VideoProvider mVideoProvider;
@@ -667,6 +668,15 @@ public abstract class Connection {
        return mIsWifi;
    }

    /**
     * Returns whether the connection uses voip audio mode
     *
     * @return {@code True} if the connection uses voip audio mode
     */
    public boolean getAudioModeIsVoip() {
        return mAudioModeIsVoip;
    }

    /**
     * Returns the {@link android.telecom.Connection.VideoProvider} for the connection.
     *
@@ -737,6 +747,15 @@ public abstract class Connection {
        }
    }

    /**
     * Set the voip audio mode for the connection
     *
     * @param isVoip {@code True} if voip audio mode is being used.
     */
    public void setAudioModeIsVoip(boolean isVoip) {
        mAudioModeIsVoip = isVoip;
    }

    /**
     * Set the audio quality for the connection.
     *
+10 −0
Original line number Diff line number Diff line
@@ -179,6 +179,11 @@ public class ImsPhoneConnection extends Connection {
                (mIsIncoming? ImsPhoneCall.State.INCOMING: ImsPhoneCall.State.DIALING));

        fetchDtmfToneDelay(phone);

        if (phone.getContext().getResources().getBoolean(
                com.android.internal.R.bool.config_use_voip_mode_for_ims)) {
            setAudioModeIsVoip(true);
        }
    }

    /** This is an MO call, created when dialing */
@@ -210,6 +215,11 @@ public class ImsPhoneConnection extends Connection {
        mIsEmergency = isEmergency;

        fetchDtmfToneDelay(phone);

        if (phone.getContext().getResources().getBoolean(
                com.android.internal.R.bool.config_use_voip_mode_for_ims)) {
            setAudioModeIsVoip(true);
        }
    }

    public void dispose() {