Loading packages/SystemUI/multivalentTests/src/com/android/systemui/user/domain/interactor/UserSwitcherInteractorTest.kt +6 −1 Original line number Diff line number Diff line Loading @@ -1088,8 +1088,13 @@ class UserSwitcherInteractorTest : SysuiTestCase() { userRepository.setUserInfos(userInfos) userRepository.setSelectedUserInfo(userInfos[1]) userRepository.setSettings(UserSwitcherSettingsModel(isUserSwitcherEnabled = false)) val selectedUser = collectLastValue(underTest.selectedUser) assertThat(selectedUser()).isNotNull() assertUser(selectedUser(), id = 1, isSelected = true) val users = collectLastValue(underTest.users) assertThat(users()?.size == 1).isTrue() assertUser(users()?.firstOrNull(), id = 1, isSelected = true) } } Loading packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserSwitcherInteractor.kt +2 −2 Original line number Diff line number Diff line Loading @@ -711,8 +711,8 @@ constructor( isUserSwitcherEnabled: Boolean, ): UserModel? { return when { // When the user switcher is not enabled in settings, we only show the primary user. !isUserSwitcherEnabled && !userInfo.isPrimary -> null // When the user switcher is not enabled in settings, we only show the current user. !isUserSwitcherEnabled && userInfo.id != selectedUserId -> null // We avoid showing disabled users. !userInfo.isEnabled -> null // We meet the conditions to return the UserModel. Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/user/domain/interactor/UserSwitcherInteractorTest.kt +6 −1 Original line number Diff line number Diff line Loading @@ -1088,8 +1088,13 @@ class UserSwitcherInteractorTest : SysuiTestCase() { userRepository.setUserInfos(userInfos) userRepository.setSelectedUserInfo(userInfos[1]) userRepository.setSettings(UserSwitcherSettingsModel(isUserSwitcherEnabled = false)) val selectedUser = collectLastValue(underTest.selectedUser) assertThat(selectedUser()).isNotNull() assertUser(selectedUser(), id = 1, isSelected = true) val users = collectLastValue(underTest.users) assertThat(users()?.size == 1).isTrue() assertUser(users()?.firstOrNull(), id = 1, isSelected = true) } } Loading
packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserSwitcherInteractor.kt +2 −2 Original line number Diff line number Diff line Loading @@ -711,8 +711,8 @@ constructor( isUserSwitcherEnabled: Boolean, ): UserModel? { return when { // When the user switcher is not enabled in settings, we only show the primary user. !isUserSwitcherEnabled && !userInfo.isPrimary -> null // When the user switcher is not enabled in settings, we only show the current user. !isUserSwitcherEnabled && userInfo.id != selectedUserId -> null // We avoid showing disabled users. !userInfo.isEnabled -> null // We meet the conditions to return the UserModel. Loading