Refresh category title by different time slot condition

Bug: 177406865
Bug: 185187729
Test: make SettingsRoboTests
Test: make SettingsGoogleRoboTests
Change-Id: Ib124e1cfb9549f838540ff547bc616049f65180d
This commit is contained in:
ykhung
2021-04-24 14:29:25 +08:00
committed by YUKAI HUNG
parent 219dabcabf
commit 41fd8a7494
7 changed files with 196 additions and 12 deletions

View File

@@ -263,10 +263,10 @@ public final class ConvertUtilsTest {
// Invokes the method first to create the SimpleDateFormat.
ConvertUtils.utcToLocalTime(/*timestamp=*/ 0);
ConvertUtils.sSimpleDateFormat
.setTimeZone(TimeZone.getTimeZone("GMT"));
.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
assertThat(ConvertUtils.utcToLocalTime(timestamp))
.isEqualTo("Apr 23,2021 16:53:06");
.isEqualTo("Apr 23,2021 09:53:06");
}
@Test
@@ -276,10 +276,10 @@ public final class ConvertUtilsTest {
// Invokes the method first to create the SimpleDateFormat.
ConvertUtils.utcToLocalTimeHour(/*timestamp=*/ 0);
ConvertUtils.sSimpleDateFormatForHour
.setTimeZone(TimeZone.getTimeZone("GMT"));
.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
assertThat(ConvertUtils.utcToLocalTimeHour(timestamp))
.isEqualTo("4 pm");
.isEqualTo("9 am");
}
private static BatteryHistEntry createBatteryHistEntry(