use of com.android.settingslib.RestrictedLockUtils.EnforcedAdmin in project android_frameworks_base by crdroidandroid.
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 crdroidandroid.
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