diff options
| author | 2023-08-14 13:09:20 +0000 | |
|---|---|---|
| committer | 2023-08-14 13:09:20 +0000 | |
| commit | edb0d3898cea4761f2a69a08a8dda05482e3fed5 (patch) | |
| tree | 67bf517ce34bf7bc2ea82daf105508f146e7b7d4 | |
| parent | 4f743e5834dd3bbf59491636fc4b3a47336f2aa5 (diff) | |
| parent | 8f1ec03d259cafb2e63cb9a0d5bebd83cfde5c85 (diff) | |
Merge "PowerManagerServiceTest: Set dreams as supported & enabled by default" into udc-qpr-dev am: 8f1ec03d25
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24353515
Change-Id: I1af4df8987e04749a7c6ba024bc6e86943fc345f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java index 431d3a61de51..fef3a35dbd3b 100644 --- a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java @@ -231,6 +231,10 @@ public class PowerManagerServiceTest { cr.addProvider(Settings.AUTHORITY, new FakeSettingsProvider()); when(mContextSpy.getContentResolver()).thenReturn(cr); + when(mResourcesSpy.getBoolean(com.android.internal.R.bool.config_dreamsSupported)) + .thenReturn(true); + when(mResourcesSpy.getBoolean(com.android.internal.R.bool.config_dreamsEnabledByDefault)) + .thenReturn(true); Settings.Global.putInt(mContextSpy.getContentResolver(), Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0); Settings.Secure.putInt(mContextSpy.getContentResolver(), @@ -1076,8 +1080,6 @@ public class PowerManagerServiceTest { @Test public void testScreensaverActivateOnSleepEnabled_powered_afterTimeout_goesToDreaming() { when(mBatteryManagerInternalMock.isPowered(anyInt())).thenReturn(true); - Settings.Secure.putInt(mContextSpy.getContentResolver(), - Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP, 1); doAnswer(inv -> { when(mDreamManagerInternalMock.isDreaming()).thenReturn(true); @@ -1099,8 +1101,6 @@ public class PowerManagerServiceTest { public void testAmbientSuppression_disablesDreamingAndWakesDevice() { Settings.Secure.putInt(mContextSpy.getContentResolver(), Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP, 1); - Settings.Secure.putInt(mContextSpy.getContentResolver(), - Settings.Secure.SCREENSAVER_ENABLED, 1); setDreamsDisabledByAmbientModeSuppressionConfig(true); setMinimumScreenOffTimeoutConfig(10000); @@ -1128,8 +1128,6 @@ public class PowerManagerServiceTest { public void testAmbientSuppressionDisabled_shouldNotWakeDevice() { Settings.Secure.putInt(mContextSpy.getContentResolver(), Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP, 1); - Settings.Secure.putInt(mContextSpy.getContentResolver(), - Settings.Secure.SCREENSAVER_ENABLED, 1); setDreamsDisabledByAmbientModeSuppressionConfig(false); setMinimumScreenOffTimeoutConfig(10000); @@ -1156,8 +1154,6 @@ public class PowerManagerServiceTest { public void testAmbientSuppression_doesNotAffectDreamForcing() { Settings.Secure.putInt(mContextSpy.getContentResolver(), Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP, 1); - Settings.Secure.putInt(mContextSpy.getContentResolver(), - Settings.Secure.SCREENSAVER_ENABLED, 1); setDreamsDisabledByAmbientModeSuppressionConfig(true); setMinimumScreenOffTimeoutConfig(10000); @@ -1183,8 +1179,6 @@ public class PowerManagerServiceTest { public void testBatteryDrainDuringDream() { Settings.Secure.putInt(mContextSpy.getContentResolver(), Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP, 1); - Settings.Secure.putInt(mContextSpy.getContentResolver(), - Settings.Secure.SCREENSAVER_ENABLED, 1); setMinimumScreenOffTimeoutConfig(100); setDreamsBatteryLevelDrainConfig(5); |