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

Commit 0f25310c authored by Sarah Chin's avatar Sarah Chin
Browse files

Handover retry checks for DATA_IS_DISCONNECTING

Removed the containsOnly check, because IMS could fail the isDataAllowed
check with reasons DATA_IS_DISCONNECTING + DATA_DISABLED when it should
bypass data enabled settings.

Test: atest DcTrackerTest
Bug: 189085285
Change-Id: I3dfbb460f814f71fb8e29254d4e6db83621bbb9c
parent c0825e3f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1623,8 +1623,7 @@ public class DcTracker extends Handler {
            }

            // Check if it fails because of the existing data is still disconnecting.
            if (dataConnectionReasons.containsOnly(
                    DataDisallowedReasonType.DATA_IS_DISCONNECTING)
            if (dataConnectionReasons.contains(DataDisallowedReasonType.DATA_IS_DISCONNECTING)
                    && isHandoverPending(apnContext.getApnTypeBitmask())) {
                // Normally we don't retry when isDataAllow() returns false, because that's consider
                // pre-condition not met, for example, data not enabled by the user, or airplane
+2 −0
Original line number Diff line number Diff line
@@ -2831,6 +2831,7 @@ public class DcTrackerTest extends TelephonyTest {
        doReturn(mApnContext).when(apnContextsByType).get(eq(ApnSetting.TYPE_IMS));
        doReturn(mApnContext).when(apnContexts).get(eq(ApnSetting.TYPE_IMS_STRING));
        doReturn(false).when(mApnContext).isConnectable();
        doReturn(false).when(mDataEnabledSettings).isDataEnabled(anyInt());
        doReturn(DctConstants.State.DISCONNECTING).when(mApnContext).getState();
        replaceInstance(DcTracker.class, "mApnContextsByType", mDct, apnContextsByType);
        replaceInstance(DcTracker.class, "mApnContexts", mDct, apnContexts);
@@ -2852,6 +2853,7 @@ public class DcTrackerTest extends TelephonyTest {
        doReturn(DctConstants.State.RETRYING).when(mApnContext).getState();
        // Data now is disconnected
        doReturn(true).when(mApnContext).isConnectable();
        doReturn(true).when(mDataEnabledSettings).isDataEnabled(anyInt());
        mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_DISCONNECT_DONE,
                new AsyncResult(Pair.create(mApnContext, 0), null, null)));