Revert consider TEMPORARILY_NOT_METERED as unmetered in data usage

Currently, NET_CAPABILITY_TEMPORARILY_NOT_METERED traffic is
counted as unmetered data usage, and "mobile data usage"
settings screen shows metered data usage which means it doesn't
include TEMPORARILY_NOT_METERED traffic. However, some carriers
show TEMPORARILY_NOT_METERED data usage in customer's bill which
would be confusing if the data usage in the device shows different
results. Thus, revert the change to avoid confusing.

Bug: 183776809
Test: FrameworksNetTests
Change-Id: I4ef25095462adf30b1ecf82134996739f167930d
This commit is contained in:
Aaron Huang
2022-12-01 21:11:12 +08:00
parent 23d8cd11c7
commit c5a05d1d8f
5 changed files with 11 additions and 17 deletions

View File

@@ -400,10 +400,8 @@ public class NetworkIdentity {
setSubscriberId(snapshot.getSubscriberId());
setRoaming(!snapshot.getNetworkCapabilities().hasCapability(
NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING));
setMetered(!(snapshot.getNetworkCapabilities().hasCapability(
NetworkCapabilities.NET_CAPABILITY_NOT_METERED)
|| snapshot.getNetworkCapabilities().hasCapability(
NetworkCapabilities.NET_CAPABILITY_TEMPORARILY_NOT_METERED)));
setMetered(!snapshot.getNetworkCapabilities().hasCapability(
NetworkCapabilities.NET_CAPABILITY_NOT_METERED));
setOemManaged(getOemBitfield(snapshot.getNetworkCapabilities()));