Skip to content

Commit

Permalink
Merge cherrypicks of ['googleplex-android-review.googlesource.com/269…
Browse files Browse the repository at this point in the history
…08656'] into 24Q2-release.

Change-Id: I1d252cb9fd8b85080f5d06552f1787609fa15923
  • Loading branch information
Android Build Coastguard Worker committed Apr 12, 2024
2 parents ca5ff1a + 2a33999 commit fdcb1ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import androidx.preference.Preference;

import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.RestrictedPreference;

import java.util.Calendar;

Expand Down Expand Up @@ -68,6 +69,11 @@ public int getAvailabilityStatus() {
@Override
public void updateState(Preference preference) {
super.updateState(preference);

if (preference instanceof RestrictedPreference
&& ((RestrictedPreference) preference).isDisabledByAdmin()) {
return;
}
preference.setEnabled(isEnabled());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import androidx.preference.Preference;

import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.RestrictedPreference;

import java.util.Calendar;

Expand Down Expand Up @@ -66,6 +67,11 @@ public int getAvailabilityStatus() {
@Override
public void updateState(Preference preference) {
super.updateState(preference);

if (preference instanceof RestrictedPreference
&& ((RestrictedPreference) preference).isDisabledByAdmin()) {
return;
}
preference.setEnabled(isEnabled());
}

Expand Down

0 comments on commit fdcb1ee

Please sign in to comment.