Add padlocks to more preferences that can be disabled by policy.
Change-Id: I7cc999dd1d46c20c888e0ba67053564e4d50946b
This commit is contained in:
@@ -20,11 +20,16 @@ import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.RestrictedPreference;
|
||||
|
||||
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
||||
|
||||
/**
|
||||
* ProviderPreference is used to display an image to the left of a provider name.
|
||||
* The preference ultimately calls AccountManager.addAccount() for the account type.
|
||||
*/
|
||||
public class ProviderPreference extends Preference {
|
||||
public class ProviderPreference extends RestrictedPreference {
|
||||
private String mAccountType;
|
||||
|
||||
public ProviderPreference(
|
||||
@@ -39,4 +44,10 @@ public class ProviderPreference extends Preference {
|
||||
public String getAccountType() {
|
||||
return mAccountType;
|
||||
}
|
||||
|
||||
public void checkAccountManagementAndSetDisabled() {
|
||||
EnforcedAdmin admin = RestrictedLockUtils.checkIfAccountManagementDisabled(
|
||||
getContext(), getAccountType());
|
||||
setDisabledByAdmin(admin);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user