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

Commit 13ce26a9 authored by Matt Sziklay's avatar Matt Sziklay Committed by Android (Google) Code Review
Browse files

Merge "Properly gate reconnect events." into main

parents 34fa917f 237086ae
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -69,7 +69,10 @@ class DesktopDisplayEventHandler(
        val uniqueDisplayId = displayController.getDisplay(displayId)?.uniqueId
        uniqueDisplayId?.let {
            uniqueIdByDisplayId[displayId] = it
            if (desktopUserRepositories.current.hasPreservedDisplayForUniqueDisplayId(it)) {
            if (
                DesktopExperienceFlags.ENABLE_DISPLAY_RECONNECT_INTERACTION.isTrue &&
                    desktopUserRepositories.current.hasPreservedDisplayForUniqueDisplayId(it)
            ) {
                desktopTasksController.restoreDisplay(displayId, it)
                return@OnDisplayAreaChangeListener
            }
@@ -99,9 +102,11 @@ class DesktopDisplayEventHandler(
                    }
                }
            )
            if (DesktopExperienceFlags.ENABLE_DISPLAY_RECONNECT_INTERACTION.isTrue) {
                desktopTasksController.preserveDisplayRequestHandler = this
            }
        }
    }

    override fun onDisplayAdded(displayId: Int) =
        traceSection(
+0 −1
Original line number Diff line number Diff line
@@ -817,7 +817,6 @@ class DesktopTasksController(
     * TODO: b/365873835 - Restore for all users, not just current.
     */
    fun restoreDisplay(displayId: Int, uniqueDisplayId: String) {
        if (!DesktopExperienceFlags.ENABLE_DISPLAY_RECONNECT_INTERACTION.isTrue) return
        logD("restoreDisplay: displayId=$displayId, uniqueDisplayId=$uniqueDisplayId")
        // TODO: b/365873835 - Utilize DesktopTask data class once it is
        //  implemented in DesktopRepository.