Skip to content

Commit

Permalink
Fix crash due to incompatible type
Browse files Browse the repository at this point in the history
fix: 331182785
Test: Manual test
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1c82f6dae63cbec0e014f94a017fb9ce86dc460e)
Merged-In: I20c150845caad1c14cad35f661c31e36def968ac
Change-Id: I20c150845caad1c14cad35f661c31e36def968ac
  • Loading branch information
tomhsu authored and thestinger committed Aug 7, 2024
1 parent 00a37a5 commit fb8cc4f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public int getAvailabilityStatus() {
@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())) {
Expand Down

0 comments on commit fb8cc4f

Please sign in to comment.