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

Unverified Commit 99647163 authored by Michael Bestas's avatar Michael Bestas
Browse files

fixup! SystemUI: Add UDFPS framework dimming support

Change-Id: I0ba720a89b3d66b9786b36bffb25624dfe226a25
parent aad94b43
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -972,11 +972,11 @@ public class UdfpsController implements DozeReceiver, Dumpable {

    private void initUdfpsFrameworkDimming() {
        mUseFrameworkDimming = mContext.getResources().getBoolean(
                com.android.systemui.R.bool.config_udfpsFrameworkDimming);
                com.android.systemui.res.R.bool.config_udfpsFrameworkDimming);

        if (mUseFrameworkDimming) {
            String[] array = mContext.getResources().getStringArray(
                    com.android.systemui.R.array.config_udfpsDimmingBrightnessAlphaArray);
                    com.android.systemui.res.R.array.config_udfpsDimmingBrightnessAlphaArray);
            mBrightnessAlphaArray = new int[array.length][2];
            for (int i = 0; i < array.length; i++) {
                String[] s = array[i].split(",");
@@ -995,9 +995,9 @@ public class UdfpsController implements DozeReceiver, Dumpable {
                Settings.System.SCREEN_BRIGHTNESS, 100);
        // Since the brightness is taken from the system settings, we need to interpolate it
        final int brightnessMin = mContext.getResources().getInteger(
                com.android.systemui.R.integer.config_udfpsDimmingBrightnessMin);
                com.android.systemui.res.R.integer.config_udfpsDimmingBrightnessMin);
        final int brightnessMax = mContext.getResources().getInteger(
                com.android.systemui.R.integer.config_udfpsDimmingBrightnessMax);
                com.android.systemui.res.R.integer.config_udfpsDimmingBrightnessMax);
        if (brightnessMax > 0) {
            brightness = interpolate(brightness, 0, 255, brightnessMin, brightnessMax);
        }
@@ -1163,7 +1163,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
        // to switch out of HBM mode. The delay, in ms is stored in config_udfpsDimmingDisableDelay.
        // If the delay is 0, the dim amount will be updated immediately.
        final int delay = mContext.getResources().getInteger(
                com.android.systemui.R.integer.config_udfpsDimmingDisableDelay);
                com.android.systemui.res.R.integer.config_udfpsDimmingDisableDelay);
        if (delay > 0) {
            mFgExecutor.executeDelayed(() -> {
                // A race condition exists where the overlay is destroyed before the dim amount