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

Commit 182c23a7 authored by tomhsu's avatar tomhsu Committed by Android Build Coastguard Worker
Browse files

Fix crash due to incompatible type

fix: 331182785
Test: Manual test
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1c82f6dae63cbec0e014f94a017fb9ce86dc460e)
Merged-In: I20c150845caad1c14cad35f661c31e36def968ac
Change-Id: I20c150845caad1c14cad35f661c31e36def968ac
parent b3b138fc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -62,6 +62,10 @@ public class AutoBrightnessPreferenceController extends TogglePreferenceControll
    @Override
    public void updateState(Preference preference) {
        super.updateState(preference);
        if (!(preference instanceof PrimarySwitchPreference)) {
            return;
        }

        PrimarySwitchPreference pref = (PrimarySwitchPreference) preference;
        if (pref.isEnabled() && UserManager.get(mContext).hasBaseUserRestriction(
                UserManager.DISALLOW_CONFIG_BRIGHTNESS, Process.myUserHandle())) {