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

Commit 5979e99d authored by Matthew Duggan's avatar Matthew Duggan
Browse files

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
Test: atest DisplayPowerControllerTest
Test: atest DisplayPowerController2Test
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5b267f70a6fcad1b161ee9cf54c2a832f567cf33)
Change-Id: I2369d10c293d7b05d55878a28f702a81428ddd15
parent dbde61ab
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2694,6 +2694,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.

+1 −0
Original line number Diff line number Diff line
@@ -3866,6 +3866,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" />
+3 −1
Original line number Diff line number Diff line
@@ -722,7 +722,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);

+5 −3
Original line number Diff line number Diff line
@@ -616,7 +616,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal

        setUpAutoBrightness(resources, handler);

        mColorFadeEnabled = mInjector.isColorFadeEnabled();
        mColorFadeEnabled = mInjector.isColorFadeEnabled(resources);
        mColorFadeFadesConfig = resources.getBoolean(
                R.bool.config_animateScreenLights);

@@ -2994,8 +2994,10 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
                    sensorManager, resources);
        }

        boolean isColorFadeEnabled() {
            return !ActivityManager.isLowRamDeviceStatic();
        boolean isColorFadeEnabled(Resources resources) {
            return !ActivityManager.isLowRamDeviceStatic()
                && !resources.getBoolean(
                  com.android.internal.R.bool.config_displayColorFadeDisabled);
        }
    }