[MS49] Remove NetworkStats hidden Api usages

This includes:
1. Remove unused INetworkStatsService and NetworkStatsHistory.
2. Replace NetworkTemplate usages with builder.
3. Replace TrafficStats references to DataUnit.
4. Reimplement NetworkTemplate#normalize.

Test: make RunSettingsRoboTests
Bug: 204830222
Change-Id: I8efecda5df403e9ed588daecd169cb3498d213a2
This commit is contained in:
Junyu Lai
2022-01-10 12:30:16 +00:00
parent 5ff3e8dc8a
commit 25e26ea7af
12 changed files with 40 additions and 32 deletions

View File

@@ -18,7 +18,7 @@ package com.android.settings.datausage;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -438,7 +438,7 @@ public class AppDataUsageTest {
assertThat(mFragment.mTemplate.getMatchRule())
.isEqualTo(NetworkTemplate.MATCH_WIFI);
assertNull(mFragment.mTemplate.getSubscriberId());
assertTrue(mFragment.mTemplate.getSubscriberIds().isEmpty());
assertThat(mFragment.mTemplate.getNetworkId())
.isEqualTo(NetworkTemplate.WIFI_NETWORKID_ALL);
}