diff options
| author | 2023-08-25 08:10:14 +0000 | |
|---|---|---|
| committer | 2023-08-25 08:10:14 +0000 | |
| commit | cf65f8bceed82eed26863b69b371d9b4f6be657b (patch) | |
| tree | 59fde44e4c4cd2e9a53cf75ba9a7129b78582961 | |
| parent | b712a758782a57a74ac1f538b32adaa1af0586af (diff) | |
| parent | f233b43664f7fc7ba047c3cfb123293ead77498f (diff) | |
Merge "PowerManagerServiceTest: Set dreams as supported & enabled by default" into udc-qpr-dev
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java | 12 |
1 files changed, 4 insertions, 8 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..3d5b0d9eb89b 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(), @@ -1099,8 +1103,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 +1130,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 +1156,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 +1181,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); |