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

Commit 56fc3206 authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Merge "Desks: Check desk exists before attempting to remove it" into main

parents 9d868b25 56658287
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3910,6 +3910,10 @@ class DesktopTasksController(

    /** Removes the given desk. */
    fun removeDesk(deskId: Int, desktopRepository: DesktopRepository = taskRepository) {
        if (!desktopRepository.getAllDeskIds().contains(deskId)) {
            logW("Request to remove desk=%d but desk not found for user=%d", deskId, userId)
            return
        }
        val displayId = desktopRepository.getDisplayForDesk(deskId)
        removeDesk(displayId = displayId, deskId = deskId, desktopRepository = desktopRepository)
    }