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

Commit 5696af10 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed network request was removed before retry

Fixed by not removing the request from the retry entry.
The request should remain in the retry entry for later
on total failed retry counting.

Fix: 229827727
Test: Sanity + atest DataNetworkControllerTest
Change-Id: I2bf3dc81ae451a8504fcde246d03569395611d0d
parent 159faa2b
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -2440,7 +2440,7 @@ public class DataNetworkController extends Handler {

    /**
     * Track the frequency of setup data failure on each
     * {@link AccessNetworkConstants#TransportType} data service.
     * {@link AccessNetworkConstants.TransportType} data service.
     *
     * @param transport The transport of the data service.
     */
@@ -2506,16 +2506,17 @@ public class DataNetworkController extends Handler {
     */
    private void onDataNetworkSetupRetry(@NonNull DataSetupRetryEntry dataSetupRetryEntry) {
        // The request might be already removed before retry happens. Remove them from the list
        // if that's the case.
        dataSetupRetryEntry.networkRequestList.removeIf(
                request -> !mAllNetworkRequestList.contains(request));
        if (dataSetupRetryEntry.networkRequestList.isEmpty()) {
        // if that's the case. Copy the list first. We don't want to remove the requests from
        // the retry entry. They can be later used to determine what kind of retry it is.
        NetworkRequestList requestList = new NetworkRequestList(
                dataSetupRetryEntry.networkRequestList);
        requestList.removeIf(request -> !mAllNetworkRequestList.contains(request));
        if (requestList.isEmpty()) {
            loge("onDataNetworkSetupRetry: Request list is empty. Abort retry.");
            dataSetupRetryEntry.setState(DataRetryEntry.RETRY_STATE_CANCELLED);
            return;
        }
        TelephonyNetworkRequest telephonyNetworkRequest =
                dataSetupRetryEntry.networkRequestList.get(0);
        TelephonyNetworkRequest telephonyNetworkRequest = requestList.get(0);

        int networkCapability = telephonyNetworkRequest.getApnTypeNetworkCapability();
        int preferredTransport = mAccessNetworksManager.getPreferredTransportByNetworkCapability(
+2 −2
Original line number Diff line number Diff line
@@ -1278,7 +1278,7 @@ public class DataRetryManager extends Handler {
                        logl(msg);
                        loge("mDataRetryEntries=" + mDataRetryEntries);
                        AnomalyReporter.reportAnomaly(UUID.fromString(
                                "afeab78c-c0b0-49fc-a51f-f766814d7aa5"), msg);
                                "afeab78c-c0b0-49fc-a51f-f766814d7aa6"), msg);
                        continue;
                    }
                    if (entry.networkRequestList.get(0).getApnTypeNetworkCapability()
@@ -1483,7 +1483,7 @@ public class DataRetryManager extends Handler {
                        logl(msg);
                        loge("mDataRetryEntries=" + mDataRetryEntries);
                        AnomalyReporter.reportAnomaly(UUID.fromString(
                                "afeab78c-c0b0-49fc-a51f-f766814d7aa5"), msg);
                                "781af571-f55d-476d-b510-7a5381f633dc"), msg);
                        continue;
                    }
                    if (entry.networkRequestList.get(0).getApnTypeNetworkCapability()
+1 −2
Original line number Diff line number Diff line
@@ -1946,7 +1946,6 @@ public class DataNetworkControllerTest extends TelephonyTest {
    public void testHandoverDataNetworkWhileSwitchTo3G() throws Exception {
        testSetupImsDataNetwork();

        DataNetwork dataNetwork = getDataNetworks().get(0);
        // Before handover the data profile is the cellular IMS data profile
        verifyConnectedNetworkHasDataProfile(mImsCellularDataProfile);

@@ -1963,7 +1962,7 @@ public class DataNetworkControllerTest extends TelephonyTest {
        // Move the time a little bit, handover still not responded.
        moveTimeForward(500);
        processAllMessages();
        dataNetwork = getDataNetworks().get(0);
        DataNetwork dataNetwork = getDataNetworks().get(0);
        // Verify the network is still on cellular, waiting for handover, although already on 3G.
        assertThat(dataNetwork.getTransport()).isEqualTo(
                AccessNetworkConstants.TRANSPORT_TYPE_WWAN);