Add handling of admin enforced restrictions in Users Settings
Before, when the restrictions were applied, the preferences that were restricted were hidden. After this change, if admin applies a restriction, the preference is displayed as disabled and Policy Transparency Dialog is displayed Bug: 338226475 Test: atest UserSettingsTest && atest UserDetailsSettingsTest Flag: android.multiuser.new_multiuser_settings_ux Change-Id: I1b5aeeeec7accde278ff3e46ea3d64c91d8400db
This commit is contained in:
@@ -43,12 +43,17 @@ public class GuestTelephonyPreferenceController extends TogglePreferenceControll
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (!mUserCaps.isAdmin() || !mUserCaps.mCanAddGuest) {
|
||||
return DISABLED_FOR_USER;
|
||||
} else if (android.multiuser.Flags.newMultiuserSettingsUx()) {
|
||||
if (android.multiuser.Flags.newMultiuserSettingsUx()) {
|
||||
if (!mUserCaps.isAdmin()) {
|
||||
return DISABLED_FOR_USER;
|
||||
}
|
||||
return AVAILABLE;
|
||||
} else {
|
||||
return mUserCaps.mUserSwitcherEnabled ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
if (!mUserCaps.isAdmin() || !mUserCaps.mCanAddGuest) {
|
||||
return DISABLED_FOR_USER;
|
||||
} else {
|
||||
return mUserCaps.mUserSwitcherEnabled ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user