Merge "Fix NetworkTemplate generates non-metered carrier template"

This commit is contained in:
Junyu Lai
2022-04-19 10:18:26 +00:00
committed by Gerrit Code Review

View File

@@ -396,7 +396,8 @@ public class NetworkPolicy implements Parcelable, Comparable<NetworkPolicy> {
return true; return true;
case MATCH_CARRIER: case MATCH_CARRIER:
case MATCH_MOBILE: case MATCH_MOBILE:
return !template.getSubscriberIds().isEmpty(); return !template.getSubscriberIds().isEmpty()
&& template.getMeteredness() == METERED_YES;
case MATCH_WIFI: case MATCH_WIFI:
if (template.getWifiNetworkKeys().isEmpty() if (template.getWifiNetworkKeys().isEmpty()
&& template.getSubscriberIds().isEmpty()) { && template.getSubscriberIds().isEmpty()) {