Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +6 −1 Original line number Diff line number Diff line Loading @@ -2721,8 +2721,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); Loading Loading @@ -2750,6 +2750,11 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { // Reset the flag. call.resetIsMergeRequestedByConf(false); } // Notify completion of merge if (conn != null) { conn.handleMergeComplete(); } logState(); } Loading tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +15 −6 Original line number Diff line number Diff line Loading @@ -935,14 +935,22 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { @Test @SmallTest public void testNumericOnlyRemap() { assertEquals(ImsReasonInfo.CODE_SIP_FORBIDDEN, mCTUT.maybeRemapReasonCode( new ImsReasonInfo(ImsReasonInfo.CODE_USER_TERMINATED_BY_REMOTE, 0))); assertEquals(ImsReasonInfo.CODE_SIP_FORBIDDEN, mCTUT.maybeRemapReasonCode( new ImsReasonInfo(ImsReasonInfo.CODE_USER_TERMINATED_BY_REMOTE, 0, ""))); 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]); } private void placeCallAndMakeActive() { private ImsPhoneConnection placeCallAndMakeActive() { try { doAnswer(new Answer<ImsCall>() { @Override Loading Loading @@ -975,6 +983,7 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { new ImsStreamMediaProfile()); imsCall.getImsCallSessionListenerProxy().callSessionStarted(imsCall.getSession(), new ImsCallProfile()); return connection; } } Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +6 −1 Original line number Diff line number Diff line Loading @@ -2721,8 +2721,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); Loading Loading @@ -2750,6 +2750,11 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { // Reset the flag. call.resetIsMergeRequestedByConf(false); } // Notify completion of merge if (conn != null) { conn.handleMergeComplete(); } logState(); } Loading
tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +15 −6 Original line number Diff line number Diff line Loading @@ -935,14 +935,22 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { @Test @SmallTest public void testNumericOnlyRemap() { assertEquals(ImsReasonInfo.CODE_SIP_FORBIDDEN, mCTUT.maybeRemapReasonCode( new ImsReasonInfo(ImsReasonInfo.CODE_USER_TERMINATED_BY_REMOTE, 0))); assertEquals(ImsReasonInfo.CODE_SIP_FORBIDDEN, mCTUT.maybeRemapReasonCode( new ImsReasonInfo(ImsReasonInfo.CODE_USER_TERMINATED_BY_REMOTE, 0, ""))); 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]); } private void placeCallAndMakeActive() { private ImsPhoneConnection placeCallAndMakeActive() { try { doAnswer(new Answer<ImsCall>() { @Override Loading Loading @@ -975,6 +983,7 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { new ImsStreamMediaProfile()); imsCall.getImsCallSessionListenerProxy().callSessionStarted(imsCall.getSession(), new ImsCallProfile()); return connection; } }