carrier data usage: Use carrier template as default policy

The carrier network means any network which linked with sepcific
subscriberId (for instances: merged Wifi or mobile).
Update default policy to use carrier network template to replace mobile
template.

No impact for current AOSP user because no any wifi network is merged
wifi. (Because the merged wifi network requires to support from the wifi module).

Also this change convert all of the old policies which template is
TYEP_MOBILE to TYPE_CARRIER to match the default policy.

Bug: 176396812
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c CtsHostsideNetworkTests
Test: Manual Test with test code (Force wifi to merged wifi).
      The data will limit when using merged wifi.
      And mobile policy also work normally.

Merged-In: I33c10f7549e713c52ce9afd5b8c4cce2abbda616
Change-Id: I33c10f7549e713c52ce9afd5b8c4cce2abbda616
This commit is contained in:
lesl
2021-01-28 15:58:23 +08:00
committed by Les Lee
parent 4ccd2e2d87
commit 35a6e5507e

View File

@@ -514,6 +514,10 @@ public class NetworkTemplate implements Parcelable {
return mSubscriberIdMatchRule; return mSubscriberIdMatchRule;
} }
public int getMeteredness() {
return mMetered;
}
/** /**
* Test if given {@link NetworkIdentity} matches this template. * Test if given {@link NetworkIdentity} matches this template.
*/ */