Disable multiuser toggle om COPE device and add explanation dialog

Bug: 304359233
Test: set up device in COPE mode and check toggle in Settings -> System -> Multiple Users

Change-Id: I0edd58651f94c9f9a51349025a29e33a1e1a9c14
This commit is contained in:
Tetiana Meronyk
2023-11-03 12:45:17 +00:00
parent b75a956c10
commit 80ae4b3c41

View File

@@ -57,11 +57,10 @@ public class MultiUserSwitchBarController implements SwitchWidgetController.OnSw
mSwitchBar.setDisabledByAdmin(RestrictedLockUtilsInternal
.checkIfRestrictionEnforced(mContext, UserManager.DISALLOW_USER_SWITCH,
UserHandle.myUserId()));
} else if (mUserCapabilities.mDisallowAddUser) {
onSwitchToggled(false);
mSwitchBar.setDisabledByAdmin(RestrictedLockUtilsInternal
.checkIfRestrictionEnforced(mContext, UserManager.DISALLOW_ADD_USER,
UserHandle.myUserId()));
.checkIfAddUserDisallowed(mContext, UserHandle.myUserId()));
} else {
mSwitchBar.setEnabled(!mUserCapabilities.mDisallowSwitchUser
&& !mUserCapabilities.mIsGuest && mUserCapabilities.isAdmin());