[ST01] Attributes data usage of test network by specifier

Currently, data usage of all test networks are all attributed to
the same NetworkIdentity, which does not allow services to
distinguish upload & download traffic of different test networks.

Thus, this CL put specifier that comes along with
TestNetworkAgent into wifiNetworkKey field to build different
NetworkIdentity to attribute data usage to different for
individual networks. And allow querying test network usage with
wifiNetworkKeys.

Bug: 139774492
Test: atest FrameworksNetTests
      atest android.net.cts.ConnectivityManagerTest
Change-Id: I1bb38fd20781eaf3105735440a04b27bef36fcae
This commit is contained in:
Junyu Lai
2022-07-25 16:31:59 +08:00
parent d407328dd4
commit c9f1ca62d9
5 changed files with 149 additions and 21 deletions

View File

@@ -1167,6 +1167,8 @@ public class ConnectivityManager {
return "PROXY";
case TYPE_VPN:
return "VPN";
case TYPE_TEST:
return "TEST";
default:
return Integer.toString(type);
}