Loading services/tests/uiservicestests/src/com/android/server/UiModeManagerServiceTest.java +16 −13 Original line number Diff line number Diff line Loading @@ -118,6 +118,7 @@ import org.mockito.Spy; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.ZoneId; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.function.Consumer; Loading Loading @@ -232,7 +233,8 @@ public class UiModeManagerServiceTest extends UiServiceTestCase { any(AlarmManager.OnAlarmListener.class), any(Handler.class)); doAnswer(inv -> { mCustomListener = () -> {}; mCustomListener = () -> { }; return null; }).when(mAlarmManager).cancel(eq(mCustomListener)); when(mContext.getSystemService(eq(Context.POWER_SERVICE))) Loading Loading @@ -1473,12 +1475,13 @@ public class UiModeManagerServiceTest extends UiServiceTestCase { assertFalse(mUiManagerService.getConfiguration().isNightModeActive()); } // attention modes with expected night modes Map<Integer, Boolean> modes = Map.of( MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode, MODE_ATTENTION_THEME_OVERLAY_DAY, false, MODE_ATTENTION_THEME_OVERLAY_NIGHT, true ); // Attention modes with expected night modes. // Important to keep modes.put(MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode) in the // first position, hence LinkedHashMap. Map<Integer, Boolean> modes = new LinkedHashMap<>(); modes.put(MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode); modes.put(MODE_ATTENTION_THEME_OVERLAY_DAY, false); modes.put(MODE_ATTENTION_THEME_OVERLAY_NIGHT, true); // test for (int attentionMode : modes.keySet()) { Loading Loading
services/tests/uiservicestests/src/com/android/server/UiModeManagerServiceTest.java +16 −13 Original line number Diff line number Diff line Loading @@ -118,6 +118,7 @@ import org.mockito.Spy; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.ZoneId; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.function.Consumer; Loading Loading @@ -232,7 +233,8 @@ public class UiModeManagerServiceTest extends UiServiceTestCase { any(AlarmManager.OnAlarmListener.class), any(Handler.class)); doAnswer(inv -> { mCustomListener = () -> {}; mCustomListener = () -> { }; return null; }).when(mAlarmManager).cancel(eq(mCustomListener)); when(mContext.getSystemService(eq(Context.POWER_SERVICE))) Loading Loading @@ -1473,12 +1475,13 @@ public class UiModeManagerServiceTest extends UiServiceTestCase { assertFalse(mUiManagerService.getConfiguration().isNightModeActive()); } // attention modes with expected night modes Map<Integer, Boolean> modes = Map.of( MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode, MODE_ATTENTION_THEME_OVERLAY_DAY, false, MODE_ATTENTION_THEME_OVERLAY_NIGHT, true ); // Attention modes with expected night modes. // Important to keep modes.put(MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode) in the // first position, hence LinkedHashMap. Map<Integer, Boolean> modes = new LinkedHashMap<>(); modes.put(MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode); modes.put(MODE_ATTENTION_THEME_OVERLAY_DAY, false); modes.put(MODE_ATTENTION_THEME_OVERLAY_NIGHT, true); // test for (int attentionMode : modes.keySet()) { Loading