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

Commit 1938da2d authored by Grant Menke's avatar Grant Menke
Browse files

Remap SIP_REQUEST_CANCELLED DisconnectCause to NORMAL.

This CL prevents dialer from displaying the incorrect pop-up after a call is terminated due to CODE_SIP_REQUEST_CANCELLED. The invalid pop-up "Call terminated due to a problem with the Network"  should not be shown in this case as this should be considered NORMAL call clearing so this CL remaps that disconnect code to DisconnectCause.NORMAL.

Flag: com.android.internal.telephony.flags.remap_disconnect_cause_sip_request_cancelled
Test: ImsPhoneCallTrackerTest#testSipRequestCancelled
Fixes: 351258918
Change-Id: Id15c7ac3969b001daba79af5726107597614acf1
parent a111d5ed
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -40,3 +40,14 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

# OWNER=grantmenke TARGET=25Q1
flag {
    name: "remap_disconnect_cause_sip_request_cancelled"
    namespace: "telephony"
    description: "Fix dialer UI bug by remapping disconnect CODE_SIP_REQUEST_CANCELLED to DisconnectCause.NORMAL"
    bug: "351258918"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -3268,6 +3268,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        int cause = DisconnectCause.ERROR_UNSPECIFIED;

        int code = maybeRemapReasonCode(reasonInfo);

        if (mFeatureFlags.remapDisconnectCauseSipRequestCancelled() &&
                code == ImsReasonInfo.CODE_SIP_REQUEST_CANCELLED) {
            return DisconnectCause.NORMAL;
        }

        switch (code) {
            case ImsReasonInfo.CODE_SIP_ALTERNATE_EMERGENCY_CALL:
                return DisconnectCause.IMS_SIP_ALTERNATE_EMERGENCY_CALL;
+11 −0
Original line number Diff line number Diff line
@@ -1475,6 +1475,17 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest {
                        Call.State.ACTIVE));
    }

    @Test
    @SmallTest
    public void testSipRequestCancelled() {
        doReturn(true).when(mFeatureFlags).remapDisconnectCauseSipRequestCancelled();

        assertEquals(DisconnectCause.NORMAL,
                mCTUT.getDisconnectCauseFromReasonInfo(
                        new ImsReasonInfo(ImsReasonInfo.CODE_SIP_REQUEST_CANCELLED, 0),
                        Call.State.DIALING));
    }

    @Test
    @SmallTest
    public void testLowBatteryDisconnectDialing() {