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

Commit 478b2182 authored by Sally Yuen's avatar Sally Yuen Committed by Android (Google) Code Review
Browse files

Merge "set enabled state of persist switch when Extra Dim state is changed" into sc-dev

parents 16f8b4c9 5d567ff1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import android.content.Context;
import android.hardware.display.ColorDisplayManager;
import android.provider.Settings;

import androidx.preference.Preference;

import com.android.settings.core.TogglePreferenceController;

/** PreferenceController for persisting feature activation state after a restart. */
@@ -54,4 +56,10 @@ public class ReduceBrightColorsPersistencePreferenceController extends TogglePre
        return Settings.Secure.putInt(mContext.getContentResolver(),
                Settings.Secure.REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS, (isChecked ? 1 : 0));
    }

    @Override
    public final void updateState(Preference preference) {
        super.updateState(preference);
        preference.setEnabled(mColorDisplayManager.isReduceBrightColorsActivated());
    }
}