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

Commit 8582f01c authored by Hall Liu's avatar Hall Liu
Browse files

Set disable add call during video call extra from carrier config

Bug: 29047863

Change-Id: Ic32f01c40337eccd197cc2573f5a01f81b35f3ea
parent 6e457cb2
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@ public abstract class Connection {
    private Bundle mExtras;
    private int mPhoneType;
    private boolean mAnsweringDisconnectsActiveCall;
    private boolean mAllowAddCallDuringVideoCall;

    protected Connection(int phoneType) {
        mPhoneType = phoneType;
@@ -763,6 +764,7 @@ public abstract class Connection {
        } else {
            mExtras = null;
        }

        for (Listener l : mListeners) {
            l.onExtrasChanged(mExtras);
        }
@@ -773,7 +775,7 @@ public abstract class Connection {
     * @return the connection extras.
     */
    public Bundle getConnectionExtras() {
        return mExtras;
        return mExtras == null ? null : new Bundle(mExtras);
    }

    /**
@@ -796,6 +798,14 @@ public abstract class Connection {
        mAnsweringDisconnectsActiveCall = answeringDisconnectsActiveCall;
    }

    public boolean shouldAllowAddCallDuringVideoCall() {
        return mAllowAddCallDuringVideoCall;
    }

    public void setAllowAddCallDuringVideoCall(boolean allowAddCallDuringVideoCall) {
        mAllowAddCallDuringVideoCall = allowAddCallDuringVideoCall;
    }

    /**
     * Sets the call substate for the current connection and reports the changes to all listeners.
     * Valid call substates are defined in {@link android.telecom.Connection}.
+11 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                                shouldDisconnectActiveCallOnAnswer(activeCall, imsCall);
                        conn.setActiveCallDisconnectedOnAnswer(answeringWillDisconnect);
                    }
                    conn.setAllowAddCallDuringVideoCall(mAllowAddCallDuringVideoCall);
                    addConnection(conn);

                    setVideoCallProvider(conn, imsCall);
@@ -240,6 +241,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
     */
    private boolean mDropVideoCallWhenAnsweringAudioCall = false;

    /**
     * Carrier configuration option which determines whether adding a call during a video call
     * should be allowed.
     */
    private boolean mAllowAddCallDuringVideoCall = true;

    //***** Events


@@ -483,6 +490,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        mDropVideoCallWhenAnsweringAudioCall =
                carrierConfig.getBoolean(
                        CarrierConfigManager.KEY_DROP_VIDEO_CALL_WHEN_ANSWERING_AUDIO_CALL_BOOL);
        mAllowAddCallDuringVideoCall =
                carrierConfig.getBoolean(
                        CarrierConfigManager.KEY_ALLOW_ADD_CALL_DURING_VIDEO_CALL_BOOL);
    }

    private void handleEcmTimer(int action) {
@@ -557,6 +567,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            mEventLog.writeOnImsCallStart(imsCall.getSession(), callees[0]);

            setVideoCallProvider(conn, imsCall);
            conn.setAllowAddCallDuringVideoCall(mAllowAddCallDuringVideoCall);
        } catch (ImsException e) {
            loge("dialInternal : " + e);
            conn.setDisconnectCause(DisconnectCause.ERROR_UNSPECIFIED);