Revert "Disable multiuser toggle when more than 1 user is created"

Revert submission 24420426-multi_toggle

Reason for revert: This change needs to be done along with some other UI changes to avoid confusion

Reverted changes: /q/submissionid:24420426-multi_toggle

Change-Id: Ife2e03d0090fefcb4c1fa53dd007336759eb1bc7
This commit is contained in:
Tetiana Meronyk
2023-09-07 15:50:09 +00:00
committed by Android (Google) Code Review
parent 7968047fc5
commit 8489ae99dc
3 changed files with 6 additions and 38 deletions

View File

@@ -65,7 +65,7 @@ public class MultiUserSwitchBarControllerTest {
UserManager.DISALLOW_USER_SWITCH, true);
final MultiUserSwitchBarController controller = new MultiUserSwitchBarController(mContext,
mSwitchBarController, true, null);
mSwitchBarController, null);
verify(mSwitchBarController).setDisabledByAdmin(any());
}
@@ -76,32 +76,8 @@ public class MultiUserSwitchBarControllerTest {
UserManager.DISALLOW_USER_SWITCH, false);
final MultiUserSwitchBarController controller = new MultiUserSwitchBarController(mContext,
mSwitchBarController, true, null);
mSwitchBarController, null);
verify(mSwitchBarController, never()).setDisabledByAdmin(any());
}
@Test
public void onStart_allowUserSwitch_setDisabledAfterInitialization_shouldBeDisabled() {
mUserManager.setUserRestriction(UserHandle.of(UserHandle.myUserId()),
UserManager.DISALLOW_USER_SWITCH, false);
final MultiUserSwitchBarController controller = new MultiUserSwitchBarController(mContext,
mSwitchBarController, true, null);
verify(mSwitchBarController).setEnabled(true);
controller.setToggleEnabled(false);
verify(mSwitchBarController).setEnabled(false);
}
@Test
public void onStart_allowUserSwitch_setEnabledAfterInitialization_shouldBeEnabled() {
mUserManager.setUserRestriction(UserHandle.of(UserHandle.myUserId()),
UserManager.DISALLOW_USER_SWITCH, false);
final MultiUserSwitchBarController controller = new MultiUserSwitchBarController(mContext,
mSwitchBarController, false, null);
verify(mSwitchBarController).setEnabled(false);
controller.setToggleEnabled(true);
verify(mSwitchBarController).setEnabled(true);
}
}