SettingsMainSwitchPreference should display the restricted icon
if it is restricted. - Use the RestrictedPreferenceHelper to check the restricted state. Fix: 179245126 Test: rebotest and see the UI Change-Id: I3c0e3bd0f3596d6fa548b6f8f10e4d12e7e50c9a
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.settings.widget;
|
||||
|
||||
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
@@ -47,7 +49,7 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
|
||||
}
|
||||
|
||||
private ImageView mRestrictedIcon;
|
||||
private RestrictedLockUtils.EnforcedAdmin mEnforcedAdmin;
|
||||
private EnforcedAdmin mEnforcedAdmin;
|
||||
private boolean mDisabledByAdmin;
|
||||
|
||||
private final MetricsFeatureProvider mMetricsFeatureProvider;
|
||||
@@ -87,7 +89,7 @@ public class SettingsMainSwitchBar extends MainSwitchBar {
|
||||
* If admin is not null, disables the text and switch but keeps the view clickable (unless the
|
||||
* switch is disabled for other reasons). Otherwise, calls setEnabled.
|
||||
*/
|
||||
public void setDisabledByAdmin(RestrictedLockUtils.EnforcedAdmin admin) {
|
||||
public void setDisabledByAdmin(EnforcedAdmin admin) {
|
||||
mEnforcedAdmin = admin;
|
||||
if (admin != null) {
|
||||
super.setEnabled(true);
|
||||
|
Reference in New Issue
Block a user