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

Commit 00df2e8c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remap SIP_REQUEST_CANCELLED DisconnectCause to NORMAL." into main

parents 14f165bc 1938da2d
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() {