Merge "Notify NetworkStatsService if TEMPORARILY_NOT_METERED changed"

This commit is contained in:
Aaron Huang
2022-11-08 11:55:53 +00:00
committed by Gerrit Code Review
2 changed files with 13 additions and 2 deletions

View File

@@ -7332,9 +7332,15 @@ public class ConnectivityServiceTest {
expectNotifyNetworkStatus(onlyCell(), onlyCell(), MOBILE_IFNAME);
reset(mStatsManager);
// Temp metered change shouldn't update ifaces
// Temp metered change should update ifaces
mCellNetworkAgent.addCapability(NET_CAPABILITY_TEMPORARILY_NOT_METERED);
waitForIdle();
expectNotifyNetworkStatus(onlyCell(), onlyCell(), MOBILE_IFNAME);
reset(mStatsManager);
// Congested change shouldn't update ifaces
mCellNetworkAgent.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED);
waitForIdle();
verify(mStatsManager, never()).notifyNetworkStatus(eq(onlyCell()),
any(List.class), eq(MOBILE_IFNAME), any(List.class));
reset(mStatsManager);