Merge "Add metered filter for API: buildTemplateCarrier"

This commit is contained in:
Les Lee
2021-05-18 13:01:38 +00:00
committed by Gerrit Code Review

View File

@@ -274,11 +274,14 @@ public class NetworkTemplate implements Parcelable {
}
/**
* Template to match all carrier networks with the given IMSI.
* Template to match all metered carrier networks with the given IMSI.
*/
public static NetworkTemplate buildTemplateCarrier(@NonNull String subscriberId) {
public static NetworkTemplate buildTemplateCarrierMetered(@NonNull String subscriberId) {
Objects.requireNonNull(subscriberId);
return new NetworkTemplate(MATCH_CARRIER, subscriberId, null);
return new NetworkTemplate(MATCH_CARRIER, subscriberId,
new String[] { subscriberId }, null /* networkId */, METERED_YES, ROAMING_ALL,
DEFAULT_NETWORK_ALL, NETWORK_TYPE_ALL, OEM_MANAGED_ALL,
SUBSCRIBER_ID_MATCH_RULE_EXACT);
}
private final int mMatchRule;