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

Commit d72f60e9 authored by Matthew Duggan's avatar Matthew Duggan
Browse files

Avoid using resources in injector for color fade config

Aligns main branch with the version merged in ag/24033386

Bug: 284838712
Test: atest DisplayPowerControllerTest
Test: atest DisplayPowerController2Test
Change-Id: I43bd7f723c3f95a4df1ca65954702caa1a346968
parent adcb9a22
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -613,7 +613,9 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal

        setUpAutoBrightness(resources, handler);

        mColorFadeEnabled = mInjector.isColorFadeEnabled(resources);
        mColorFadeEnabled = mInjector.isColorFadeEnabled()
                && !resources.getBoolean(
                  com.android.internal.R.bool.config_displayColorFadeDisabled);
        mColorFadeFadesConfig = resources.getBoolean(
                R.bool.config_animateScreenLights);

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

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