Allow separate configuration of display color fade

Previously color fade before display power-off was disabled for devices
with a low-RAM configuration.  Some devices may not want this animation
even though they have a plenty of RAM, so allow it to be controlled
separately.

Bug: 284838712
Change-Id: I2369d10c293d7b05d55878a28f702a81428ddd15
Merged-In: I2369d10c293d7b05d55878a28f702a81428ddd15
Test: atest DisplayPowerControllerTest
Test: atest DisplayPowerController2Test
This commit is contained in:
Matthew Duggan
2023-07-12 13:39:06 +09:00
parent 009c7c26c2
commit 0ea9de1cf9
4 changed files with 10 additions and 2 deletions

View File

@@ -2683,6 +2683,9 @@
backlight values -->
<bool name="config_displayBrightnessBucketsInDoze">false</bool>
<!-- True to skip the fade animation on display off event -->
<bool name="config_displayColorFadeDisabled">false</bool>
<!-- Power Management: Specifies whether to decouple the auto-suspend state of the
device from the display on/off state.

View File

@@ -3852,6 +3852,7 @@
<java-symbol type="bool" name="config_dozeSupportsAodWallpaper" />
<java-symbol type="bool" name="config_displayBlanksAfterDoze" />
<java-symbol type="bool" name="config_displayBrightnessBucketsInDoze" />
<java-symbol type="bool" name="config_displayColorFadeDisabled" />
<java-symbol type="integer" name="config_storageManagerDaystoRetainDefault" />
<java-symbol type="string" name="config_headlineFontFamily" />
<java-symbol type="string" name="config_headlineFontFamilyMedium" />

View File

@@ -718,7 +718,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
setUpAutoBrightness(resources, handler);
mColorFadeEnabled = !ActivityManager.isLowRamDeviceStatic();
mColorFadeEnabled = !ActivityManager.isLowRamDeviceStatic()
&& !resources.getBoolean(
com.android.internal.R.bool.config_displayColorFadeDisabled);
mColorFadeFadesConfig = resources.getBoolean(
com.android.internal.R.bool.config_animateScreenLights);

View File

@@ -610,7 +610,9 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
setUpAutoBrightness(resources, handler);
mColorFadeEnabled = mInjector.isColorFadeEnabled();
mColorFadeEnabled = mInjector.isColorFadeEnabled()
&& !resources.getBoolean(
com.android.internal.R.bool.config_displayColorFadeDisabled);
mColorFadeFadesConfig = resources.getBoolean(
R.bool.config_animateScreenLights);