use of com.android.settingslib.RestrictedLockUtils.EnforcedAdmin in project android_frameworks_base by AOSPA.
the class RestrictedPreferenceHelper method checkRestrictionAndSetDisabled.
/**
* Set the user restriction that is used to disable this preference.
*
* @param userRestriction constant from {@link android.os.UserManager}
* @param userId user to check the restriction for.
*/
public void checkRestrictionAndSetDisabled(String userRestriction, int userId) {
EnforcedAdmin admin = RestrictedLockUtils.checkIfRestrictionEnforced(mContext, userRestriction, userId);
setDisabledByAdmin(admin);
}
use of com.android.settingslib.RestrictedLockUtils.EnforcedAdmin in project android_frameworks_base by AOSPA.
the class UserSwitcherController method checkIfAddUserDisallowedByAdminOnly.
private void checkIfAddUserDisallowedByAdminOnly(UserRecord record) {
EnforcedAdmin admin = RestrictedLockUtils.checkIfRestrictionEnforced(mContext, UserManager.DISALLOW_ADD_USER, ActivityManager.getCurrentUser());
if (admin != null && !RestrictedLockUtils.hasBaseUserRestriction(mContext, UserManager.DISALLOW_ADD_USER, ActivityManager.getCurrentUser())) {
record.isDisabledByAdmin = true;
record.enforcedAdmin = admin;
} else {
record.isDisabledByAdmin = false;
record.enforcedAdmin = null;
}
}
use of com.android.settingslib.RestrictedLockUtils.EnforcedAdmin in project android_frameworks_base by DirtyUnicorns.
the class UserSwitcherController method checkIfAddUserDisallowedByAdminOnly.
private void checkIfAddUserDisallowedByAdminOnly(UserRecord record) {
EnforcedAdmin admin = RestrictedLockUtils.checkIfRestrictionEnforced(mContext, UserManager.DISALLOW_ADD_USER, ActivityManager.getCurrentUser());
if (admin != null && !RestrictedLockUtils.hasBaseUserRestriction(mContext, UserManager.DISALLOW_ADD_USER, ActivityManager.getCurrentUser())) {
record.isDisabledByAdmin = true;
record.enforcedAdmin = admin;
} else {
record.isDisabledByAdmin = false;
record.enforcedAdmin = null;
}
}
use of com.android.settingslib.RestrictedLockUtils.EnforcedAdmin in project android_frameworks_base by DirtyUnicorns.
the class QSTile method checkIfRestrictionEnforcedByAdminOnly.
protected void checkIfRestrictionEnforcedByAdminOnly(State state, String userRestriction) {
EnforcedAdmin admin = RestrictedLockUtils.checkIfRestrictionEnforced(mContext, userRestriction, ActivityManager.getCurrentUser());
if (admin != null && !RestrictedLockUtils.hasBaseUserRestriction(mContext, userRestriction, ActivityManager.getCurrentUser())) {
state.disabledByPolicy = true;
state.enforcedAdmin = admin;
} else {
state.disabledByPolicy = false;
state.enforcedAdmin = null;
}
}
use of com.android.settingslib.RestrictedLockUtils.EnforcedAdmin in project android_frameworks_base by ResurrectionRemix.
the class UserSwitcherController method checkIfAddUserDisallowedByAdminOnly.
private void checkIfAddUserDisallowedByAdminOnly(UserRecord record) {
EnforcedAdmin admin = RestrictedLockUtils.checkIfRestrictionEnforced(mContext, UserManager.DISALLOW_ADD_USER, ActivityManager.getCurrentUser());
if (admin != null && !RestrictedLockUtils.hasBaseUserRestriction(mContext, UserManager.DISALLOW_ADD_USER, ActivityManager.getCurrentUser())) {
record.isDisabledByAdmin = true;
record.enforcedAdmin = admin;
} else {
record.isDisabledByAdmin = false;
record.enforcedAdmin = null;
}
}
Aggregations