Support to query TYPE_WIFI usage with subscriberId

Previous the API ignores subscriberId when network type is WIFI.
Allow caller to call querySummaryXXXX with TYPE: WIFI
+ subscriberId: IMSI to get carrier merged wifi usage which matches the wifi
network with the given IMSI.

Bug: 176396812
Test: atest -c NetworkStatsServiceTest
Change-Id: Ia033521a24e2bb56182d74a41bb2b39710571782
This commit is contained in:
lesl
2021-02-25 23:15:07 +08:00
committed by Les Lee
parent b679f00398
commit dfc7237743

View File

@@ -644,7 +644,10 @@ public class NetworkStatsManager {
: NetworkTemplate.buildTemplateMobileAll(subscriberId);
break;
case ConnectivityManager.TYPE_WIFI:
template = NetworkTemplate.buildTemplateWifiWildcard();
template = subscriberId == null
? NetworkTemplate.buildTemplateWifiWildcard()
: NetworkTemplate.buildTemplateWifi(NetworkTemplate.WIFI_NETWORKID_ALL,
subscriberId);
break;
default:
throw new IllegalArgumentException("Cannot create template for network type "