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

Commit 8a9e4a8a authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Signal EVENT_MERGE_COMPLETE connection event on merge completion.

am: 78f4cbd8

Change-Id: Id99c4e64e621d220cc5efe41ff96a2517de60888
parents 297d59b6 78f4cbd8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2732,8 +2732,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            }
            foregroundImsPhoneCall.merge(peerImsPhoneCall, ImsPhoneCall.State.ACTIVE);

            try {
            final ImsPhoneConnection conn = findConnection(call);
            try {
                log("onCallMerged: ImsPhoneConnection=" + conn);
                log("onCallMerged: CurrentVideoProvider=" + conn.getVideoProvider());
                setVideoCallProvider(conn, call);
@@ -2761,6 +2761,11 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                // Reset the flag.
                call.resetIsMergeRequestedByConf(false);
            }

            // Notify completion of merge
            if (conn != null) {
                conn.handleMergeComplete();
            }
            logState();
        }

+19 −1
Original line number Diff line number Diff line
@@ -943,6 +943,23 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest {
        Assert.fail("Expected CallStateException");
    }

    @Test
    @SmallTest
    public void testMergeComplete() {
        boolean[] result = new boolean[1];
        // Place a call.
        ImsPhoneConnection connection = placeCallAndMakeActive();
        connection.addListener(new Connection.ListenerBase() {
            @Override
            public void onConnectionEvent(String event, Bundle extras) {
                result[0] = android.telecom.Connection.EVENT_MERGE_COMPLETE.equals(event);
            }
        });
        ImsCall call = connection.getImsCall();
        call.getListener().onCallMerged(call, null, false);
        assertTrue(result[0]);
    }

    @Test
    @SmallTest
    public void testNumericOnlyRemap() {
@@ -984,7 +1001,7 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest {
                                "SERVICE not allowed in this location")));
    }

    private void placeCallAndMakeActive() {
    private ImsPhoneConnection placeCallAndMakeActive() {
        try {
            doAnswer(new Answer<ImsCall>() {
                @Override
@@ -1017,6 +1034,7 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest {
                new ImsStreamMediaProfile());
        imsCall.getImsCallSessionListenerProxy().callSessionStarted(imsCall.getSession(),
                new ImsCallProfile());
        return connection;
    }
}