diff options
| author | Les Lee <lesl@google.com> | 2021-11-06 01:11:32 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-11-06 01:11:32 +0000 |
| commit | a42b6bffbbd0f7da7ebf06dd4059269dc01b4c96 (patch) | |
| tree | 89bb7876887baa7a9550d544c1c992a4ec168e75 /core/java | |
| parent | 83da6cfd938e101fb6870fa36f08b2710e8e62eb (diff) | |
| parent | a1e47b652b5d203a3cdfa410e6d63f262c29ce02 (diff) | |
Merge "Fix normalize doesn't work on carrier template" am: a1e47b652b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878227
Change-Id: I955970137e916ab402c3a81a6656a22cc5c45c99
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/NetworkTemplate.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/java/android/net/NetworkTemplate.java b/core/java/android/net/NetworkTemplate.java index 74506dae329b..ee24084e63c6 100644 --- a/core/java/android/net/NetworkTemplate.java +++ b/core/java/android/net/NetworkTemplate.java @@ -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)) { |
