Fix incorrect battery history merging logic to cause data losing

Bug: 184807417
Test: make SettingsRoboTests
Test: make SettingsGoogleRoboTests
Change-Id: Ic26799f4d95b9f990e873ee26a42d6cc0c404659
This commit is contained in:
ykhung
2021-04-25 16:09:59 +08:00
committed by YUKAI HUNG
parent 41fd8a7494
commit 5e578ddd13
2 changed files with 7 additions and 5 deletions

View File

@@ -370,7 +370,8 @@ public final class BatteryChartPreferenceControllerTest {
pref, createBatteryDiffEntry(
/*foregroundUsageTimeInMs=*/ DateUtils.MINUTE_IN_MILLIS,
/*backgroundUsageTimeInMs=*/ 200));
assertThat(pref.getSummary()).isEqualTo("Total: 1 min");
assertThat(pref.getSummary())
.isEqualTo("Total: 1 min\nBackground: less than a min");
}
@Test