Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f562c96a authored by Brad Hinegardner's avatar Brad Hinegardner Committed by Automerger Merge Worker
Browse files

Merge "Fix no guest visible while on multi user switcher" into tm-qpr-dev am:...

Merge "Fix no guest visible while on multi user switcher" into tm-qpr-dev am: 95799ff2 am: 95b8f5b7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20581318



Change-Id: I7b58c5470cdf74777cab331fc4b30ee276537d37
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a2c4b4f7 95b8f5b7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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. */
+3 −3
Original line number Diff line number Diff line
@@ -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()
        }