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

Commit a8d64d73 authored by Jorge Gil's avatar Jorge Gil
Browse files

Desks: Always set |userIdToProfileIdsMap| on init

Partially reverts If05494258ac9426e685f654fdc44f740587bf06a. Setting the
user to profile map on init is still needed in case the current
repository is accessed between init and onInit().

Flag: com.android.window.flags.enable_multiple_desktops_backend
Bug: 411276711
Test: atest DesktopUserRepositories
Change-Id: I5dda0500b2eb62e3fa67df659ff8417e3a18c05f
parent 82654ed9
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -66,15 +66,12 @@ class DesktopUserRepositories(

    init {
        userId = ActivityManager.getCurrentUser()
        if (ENABLE_DESKTOP_WINDOWING_HSUM.isTrue) {
            userIdToProfileIdsMap[userId] = userManager.getProfiles(userId).map { it.id }
        }
        if (desktopState.canEnterDesktopMode) {
            shellInit.addInitCallback(::onInit, this)
        }
        if (
            ENABLE_DESKTOP_WINDOWING_HSUM.isTrue() &&
                !DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue
        ) {
            userIdToProfileIdsMap[userId] = userManager.getProfiles(userId).map { it.id }
        }
    }

    private fun onInit() {