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

Commit 5701e772 authored by Jack Yu's avatar Jack Yu
Browse files

Retry setup data when reset data throttling

Test: atest DataRetryManagerTest
Fix: 222323541
Merged-In: Ida5651ecda3ee575358a639eb42d2574a455db53
Change-Id: Ida5651ecda3ee575358a639eb42d2574a455db53
parent 0c9543cb
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -903,7 +903,7 @@ public class DataRetryManager extends Handler {
         *
         * @param throttleStatusList List of throttle status.
         */
        public void onThrottleStatusChanged(List<ThrottleStatus> throttleStatusList) {}
        public void onThrottleStatusChanged(@NonNull List<ThrottleStatus> throttleStatusList) {}
    }

    /**
@@ -1216,7 +1216,12 @@ public class DataRetryManager extends Handler {

        final List<ThrottleStatus> throttleStatusList = new ArrayList<>();
        for (DataThrottlingEntry dataThrottlingEntry : mDataThrottlingEntries) {
            throttleStatusList.addAll(dataThrottlingEntry.dataProfile.getApnSetting().getApnTypes()
            DataProfile dataProfile = dataThrottlingEntry.dataProfile;
            String apn = dataProfile.getApnSetting() != null
                    ? dataProfile.getApnSetting().getApnName() : null;
            onDataProfileUnthrottled(dataProfile, apn, dataThrottlingEntry.transport);
            if (dataProfile.getApnSetting() != null) {
                throttleStatusList.addAll(dataProfile.getApnSetting().getApnTypes()
                        .stream()
                        .map(apnType -> new ThrottleStatus.Builder()
                                .setApnType(apnType)
@@ -1227,9 +1232,6 @@ public class DataRetryManager extends Handler {
                                .build())
                        .collect(Collectors.toList()));
            }
        if (!throttleStatusList.isEmpty()) {
            mDataRetryManagerCallbacks.forEach(callback -> callback.invokeFromExecutor(
                    () -> callback.onThrottleStatusChanged(throttleStatusList)));
        }

        mDataThrottlingEntries.clear();