Merge "Fix normalize doesn't work on carrier template" into sc-qpr1-dev am: ae28e40017

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

Change-Id: If028ed5e3160ab3d0054ce5a8444e6d12d700e3c
This commit is contained in:
Ahming Chen
2021-11-12 11:03:41 +00:00
committed by Automerger Merge Worker

View File

@@ -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)) {