Loading services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -1066,9 +1066,13 @@ public class PowerManagerServiceTest { @SuppressWarnings("GuardedBy") @Test public void testScreensaverActivateOnSleepEnabled_powered_afterTimeout_goesToDreaming() { when(mResourcesSpy.getBoolean(com.android.internal.R.bool.config_dreamsSupported)) .thenReturn(true); when(mBatteryManagerInternalMock.isPowered(anyInt())).thenReturn(true); Settings.Secure.putInt(mContextSpy.getContentResolver(), Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP, 1); Settings.Secure.putInt(mContextSpy.getContentResolver(), Settings.Secure.SCREENSAVER_ENABLED, 1); doAnswer(inv -> { when(mDreamManagerInternalMock.isDreaming()).thenReturn(true); Loading Loading
services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -1066,9 +1066,13 @@ public class PowerManagerServiceTest { @SuppressWarnings("GuardedBy") @Test public void testScreensaverActivateOnSleepEnabled_powered_afterTimeout_goesToDreaming() { when(mResourcesSpy.getBoolean(com.android.internal.R.bool.config_dreamsSupported)) .thenReturn(true); when(mBatteryManagerInternalMock.isPowered(anyInt())).thenReturn(true); Settings.Secure.putInt(mContextSpy.getContentResolver(), Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP, 1); Settings.Secure.putInt(mContextSpy.getContentResolver(), Settings.Secure.SCREENSAVER_ENABLED, 1); doAnswer(inv -> { when(mDreamManagerInternalMock.isDreaming()).thenReturn(true); Loading