diff options
| author | 2022-11-30 14:28:00 +0000 | |
|---|---|---|
| committer | 2022-11-30 14:28:00 +0000 | |
| commit | 95799ff292b57dee6b39bc2968ca2106732d7cb2 (patch) | |
| tree | c1e7a3963d001c306d6bbe40f3ce0eaa15c05b97 | |
| parent | 13ea38e020e25dcc86b8c1154801a59789a4b0d8 (diff) | |
| parent | 62c898a705f6cd83fb4c404e6b9e9937f7b3b950 (diff) | |
Merge "Fix no guest visible while on multi user switcher" into tm-qpr-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserInteractor.kt | 6 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserInteractor.kt b/packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserInteractor.kt index c5b697c90e0c..d7b0971d9126 100644 --- a/packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/user/domain/interactor/UserInteractor.kt @@ -114,9 +114,9 @@ constructor( private val callbackMutex = Mutex() private val callbacks = mutableSetOf<UserCallback>() - private val userInfos = - combine(repository.userSwitcherSettings, repository.userInfos) { settings, userInfos -> - userInfos.filter { !it.isGuest || canCreateGuestUser(settings) }.filter { it.isFull } + private val userInfos: Flow<List<UserInfo>> = + repository.userInfos.map { userInfos -> + userInfos.filter { it.isFull } } /** List of current on-device users to select from. */ diff --git a/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt index 50d239d25607..78b0cbe8c718 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt @@ -761,7 +761,7 @@ class UserInteractorTest : SysuiTestCase() { } @Test - fun `users - secondary user - no guest user`() = + fun `users - secondary user - guest user can be switched to`() = runBlocking(IMMEDIATE) { val userInfos = createUserInfos(count = 3, includeGuest = true) userRepository.setUserInfos(userInfos) @@ -770,8 +770,8 @@ class UserInteractorTest : SysuiTestCase() { var res: List<UserModel>? = null val job = underTest.users.onEach { res = it }.launchIn(this) - assertThat(res?.size == 2).isTrue() - assertThat(res?.find { it.isGuest }).isNull() + assertThat(res?.size == 3).isTrue() + assertThat(res?.find { it.isGuest }).isNotNull() job.cancel() } |