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

Commit bc89ec0f authored by Les Lee's avatar Les Lee Committed by Automerger Merge Worker
Browse files

Merge "Fix normalize doesn't work on carrier template" am: a1e47b65 am:...

Merge "Fix normalize doesn't work on carrier template" am: a1e47b65 am: a42b6bff am: 10f7bb62 am: 05406865 am: f735cc38

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878227

Change-Id: Ibb25859b34532cc07f9b11cbc106a8b4acc3b8f9
parents b7e00ee8 f735cc38
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -777,8 +777,8 @@ public class NetworkTemplate implements Parcelable {
    }

    /**
     * Examine the given template and normalize if it refers to a "merged"
     * mobile subscriber. We pick the "lowest" merged subscriber as the primary
     * Examine the given template and normalize it.
     * We pick the "lowest" merged subscriber as the primary
     * for key purposes, and expand the template to match all other merged
     * subscribers.
     * <p>
@@ -793,8 +793,8 @@ public class NetworkTemplate implements Parcelable {
    }

    /**
     * Examine the given template and normalize if it refers to a "merged"
     * mobile subscriber. We pick the "lowest" merged subscriber as the primary
     * Examine the given template and normalize it.
     * We pick the "lowest" merged subscriber as the primary
     * for key purposes, and expand the template to match all other merged
     * subscribers.
     *
@@ -806,7 +806,12 @@ public class NetworkTemplate implements Parcelable {
     * A, but also matches B.
     */
    public static NetworkTemplate normalize(NetworkTemplate template, List<String[]> mergedList) {
        if (!template.isMatchRuleMobile()) return template;
        // Now there are several types of network which uses SubscriberId to store network
        // information. For instances:
        // The TYPE_WIFI with subscriberId means that it is a merged carrier wifi network.
        // The TYPE_CARRIER means that the network associate to specific carrier network.

        if (template.mSubscriberId == null) return template;

        for (String[] merged : mergedList) {
            if (ArrayUtils.contains(merged, template.mSubscriberId)) {