Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78f60a28 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure that dreams are "supported" in service tests"

parents 772546e0 f6b0d1e7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);