Merge "Fix cell stats did not increase due to rate limit in battery stats"

This commit is contained in:
Aaron Huang
2022-12-05 14:45:08 +00:00
committed by Gerrit Code Review

View File

@@ -155,6 +155,13 @@ public class BatteryStatsManagerTest{
// removing data activity tracking.
mCtsNetUtils.ensureWifiConnected();
// There's rate limit to update mobile battery so if ConnectivityService calls
// BatteryStatsManager.reportMobileRadioPowerState when default network changed,
// the mobile stats might not be updated. But if the mobile update due to other
// reasons (plug/unplug, battery level change, etc) will be unaffected. Thus here
// dumps the battery stats to trigger a full sync of data.
executeShellCommand("dumpsys batterystats");
// Check cellular battery stats are updated.
runAsShell(UPDATE_DEVICE_STATS,
() -> assertStatsEventually(mBsm::getCellularBatteryStats,