diff options
| author | 2021-11-16 00:45:38 +0000 | |
|---|---|---|
| committer | 2021-11-16 00:45:38 +0000 | |
| commit | 682db90042f42d9c5a838be77b31a1da823b617b (patch) | |
| tree | b46587f2adedaa1be511990fa324f88cb93791d8 | |
| parent | 509a29f8a0f60772e0f7dfddf00b39007f8ddbeb (diff) | |
| parent | b94122d92e9044332bef64ab1791f10575973da7 (diff) | |
Merge "Merge "Fix normalize doesn't work on carrier template" into sc-qpr1-dev am: ae28e40017" into sc-v2-dev
| -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 fee2e2b27457..798a0015925e 100644 --- a/core/java/android/net/NetworkTemplate.java +++ b/core/java/android/net/NetworkTemplate.java @@ -764,8 +764,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> @@ -780,8 +780,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. * @@ -793,7 +793,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)) { |