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

Commit 6fd49b51 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Prevent unnecessary waiting APN index reset" into sc-dev am: 5720483d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/14370231

Change-Id: I2697c67a1609704d68b1c5ce1a9a3f181c3e484b
parents d0f75ba5 5720483d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ public class RetryManager {
     * The list to store APN setting candidates for data call setup. Most of the carriers only have
     * one APN, but few carriers have more than one.
     */
    private ArrayList<ApnSetting> mWaitingApns = null;
    private ArrayList<ApnSetting> mWaitingApns = new ArrayList<>();

    /**
     * Index pointing to the current trying APN from mWaitingApns
@@ -683,7 +683,7 @@ public class RetryManager {
     * Get the list of waiting APNs.
     * @return the list of waiting APNs
     */
    public ArrayList<ApnSetting> getWaitingApns() {
    public @NonNull ArrayList<ApnSetting> getWaitingApns() {
        return mWaitingApns;
    }

+4 −5
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.telephony.dataconnection;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.net.NetworkCapabilities;
import android.net.NetworkRequest;
@@ -256,7 +257,7 @@ public class ApnContext {
     * Get the list of waiting APNs.
     * @return the list of waiting APNs
     */
    public ArrayList<ApnSetting> getWaitingApns() {
    public @NonNull ArrayList<ApnSetting> getWaitingApns() {
        return mRetryManager.getWaitingApns();
    }

@@ -289,12 +290,10 @@ public class ApnContext {
        }

        if (mState == DctConstants.State.FAILED) {
            if (mRetryManager.getWaitingApns() != null) {
            // when teardown the connection and set to IDLE
            mRetryManager.getWaitingApns().clear();
        }
    }
    }

    /**
     * Get the current data call state.
+6 −2
Original line number Diff line number Diff line
@@ -3568,7 +3568,8 @@ public class DcTracker extends Handler {
     * @return waitingApns list to be used to create PDP
     *          error when waitingApns.isEmpty()
     */
    private ArrayList<ApnSetting> buildWaitingApns(String requestedApnType, int radioTech) {
    private @NonNull ArrayList<ApnSetting> buildWaitingApns(String requestedApnType,
            int radioTech) {
        if (DBG) log("buildWaitingApns: E requestedApnType=" + requestedApnType);
        ArrayList<ApnSetting> apnList = new ArrayList<ApnSetting>();

@@ -4740,7 +4741,10 @@ public class DcTracker extends Handler {
                if (!apnContext.isDisconnected()) {
                    ArrayList<ApnSetting> waitingApns = buildWaitingApns(
                            apnContext.getApnType(), getDataRat());
                    if (apnContext.getWaitingApns().size() != waitingApns.size()
                            || !apnContext.getWaitingApns().containsAll(waitingApns)) {
                        apnContext.setWaitingApns(waitingApns);
                    }
                    for (ApnSetting apnSetting : waitingApns) {
                        if (areCompatible(apnSetting, apnContext.getApnSetting())) {
                            cleanupRequired = false;