Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +8 −0 Original line number Diff line number Diff line Loading @@ -2878,6 +2878,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { ImsPhoneConnection conn = findConnection(imsCall); boolean rejectCall = false; if (mFeatureFlags.preventHangupDuringCallMerge()) { if (imsCall.isCallSessionMergePending()) { if (DBG) log("hangup call failed during call merge"); throw new CallStateException("can not hangup during call merge"); } } String logResult = "(undefined)"; if (call == mRingingCall) { logResult = "(ringing) hangup incoming"; Loading tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +26 −0 Original line number Diff line number Diff line Loading @@ -2774,6 +2774,32 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { assertNetworkStatsEquals(expectedStats, uidStatsCaptor.getValue()); } @Test public void testPreventHangupDuringCallMerge() { // Enable feature flag doReturn(true).when(mFeatureFlags).preventHangupDuringCallMerge(); // Change carrier config to allow call hold for 2nd call setup PersistableBundle bundle = mContextFixture.getCarrierConfigBundle(); bundle.putBoolean(CarrierConfigManager.KEY_ALLOW_HOLD_VIDEO_CALL_BOOL, true); mCTUT.updateCarrierConfigCache(bundle); // Place a call. placeCallAndMakeActive(); // Place a 2nd call ImsPhoneConnection imsPhoneConnection = placeCallAndMakeActive(); // Try call merge mCTUT.conference(); try { mCTUT.hangup(imsPhoneConnection.getCall()); fail("Expect CallStateException but not"); } catch (CallStateException e) { // Expected exception } } private ImsPhoneConnection placeCallAndMakeActive() { ImsPhoneConnection connection = placeCall(); ImsCall imsCall = connection.getImsCall(); Loading Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +8 −0 Original line number Diff line number Diff line Loading @@ -2878,6 +2878,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { ImsPhoneConnection conn = findConnection(imsCall); boolean rejectCall = false; if (mFeatureFlags.preventHangupDuringCallMerge()) { if (imsCall.isCallSessionMergePending()) { if (DBG) log("hangup call failed during call merge"); throw new CallStateException("can not hangup during call merge"); } } String logResult = "(undefined)"; if (call == mRingingCall) { logResult = "(ringing) hangup incoming"; Loading
tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +26 −0 Original line number Diff line number Diff line Loading @@ -2774,6 +2774,32 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { assertNetworkStatsEquals(expectedStats, uidStatsCaptor.getValue()); } @Test public void testPreventHangupDuringCallMerge() { // Enable feature flag doReturn(true).when(mFeatureFlags).preventHangupDuringCallMerge(); // Change carrier config to allow call hold for 2nd call setup PersistableBundle bundle = mContextFixture.getCarrierConfigBundle(); bundle.putBoolean(CarrierConfigManager.KEY_ALLOW_HOLD_VIDEO_CALL_BOOL, true); mCTUT.updateCarrierConfigCache(bundle); // Place a call. placeCallAndMakeActive(); // Place a 2nd call ImsPhoneConnection imsPhoneConnection = placeCallAndMakeActive(); // Try call merge mCTUT.conference(); try { mCTUT.hangup(imsPhoneConnection.getCall()); fail("Expect CallStateException but not"); } catch (CallStateException e) { // Expected exception } } private ImsPhoneConnection placeCallAndMakeActive() { ImsPhoneConnection connection = placeCall(); ImsCall imsCall = connection.getImsCall(); Loading