summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ahming Chen <ahmingchen@google.com> 2021-11-12 10:50:49 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-11-12 10:50:49 +0000
commitae28e40017abbfc442834f2c41f86c11bcf9456f (patch)
treeffd1db9e0d1f4901388266956fcc7c8e1a2612f6
parent734bde2baa7b42e5e82e43ac501634cc05598e8a (diff)
parent46cc261aa90305bdfec668af5d5ed25a27032cda (diff)
Merge "Fix normalize doesn't work on carrier template" into sc-qpr1-dev
-rw-r--r--core/java/android/net/NetworkTemplate.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/java/android/net/NetworkTemplate.java b/core/java/android/net/NetworkTemplate.java
index 249154aa9129..762816dd9f11 100644
--- a/core/java/android/net/NetworkTemplate.java
+++ b/core/java/android/net/NetworkTemplate.java
@@ -782,8 +782,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>
@@ -798,8 +798,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.
*
@@ -811,7 +811,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)) {