Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +6 −2 Original line number Diff line number Diff line Loading @@ -5177,7 +5177,6 @@ class DesktopTasksController( userId = userId, enterReason = enterReason, ) // Put task with [taskIdToReorderToFront] to front. when (newTaskInFront) { is RunningTaskInfo -> { Loading @@ -5200,6 +5199,12 @@ class DesktopTasksController( } } // Exploded view is where tasks are exploded within a desktop on entering recents, // so if the user selects a tiled task to be in front, tiling should handle this // to bring all tiled tasks to front. if (taskIdToReorderToFront != INVALID_TASK_ID && taskIdToReorderToFront != null) { snapEventHandler.notifyTilingOfExplodedViewReorder(deskId, taskIdToReorderToFront) } val transitionType = transitionType(remoteTransition) val handler = remoteTransition?.let { Loading @@ -5209,7 +5214,6 @@ class DesktopTasksController( val transition = transitions.startTransition(transitionType, wct, handler) handler?.setTransition(transition) runOnTransitStart?.invoke(transition) // Replaced by |IDesktopTaskListener#onActiveDeskChanged|. if (!desktopState.enableMultipleDesktops) { desktopModeEnterExitTransitionListener?.onEnterDesktopModeTransitionStarted( Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +5 −0 Original line number Diff line number Diff line Loading @@ -1049,6 +1049,11 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, currentDragBounds); } @Override public void notifyTilingOfExplodedViewReorder(int deskId, int topTaskId) { mDesktopTilingDecorViewModel.onExplodedViewReorder(deskId, topTaskId); } @Override public void onDeskActivated(int deskId, int displayId) { if (mDesktopTilingDecorViewModel.tilingDeskActive(deskId)) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModel.kt +4 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,10 @@ class DesktopTilingDecorViewModel( tilingHandlerByUserAndDeskId[currentUserId]?.remove(deskId) } fun onExplodedViewReorder(deskId: Int, topTaskId: Int) { tilingHandlerByUserAndDeskId[currentUserId]?.get(deskId)?.onExplodedViewReorder(topTaskId) } fun getCurrentActiveDeskForDisplay(displayId: Int): Int? = desktopUserRepositories.current.getActiveDeskId(displayId) Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecoration.kt +14 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ import com.android.wm.shell.shared.desktopmode.DesktopState import com.android.wm.shell.sysui.ShellController import com.android.wm.shell.transition.FocusTransitionObserver import com.android.wm.shell.transition.Transitions import com.android.wm.shell.transition.Transitions.TRANSIT_END_RECENTS_TRANSITION import com.android.wm.shell.transition.Transitions.TRANSIT_MINIMIZE import com.android.wm.shell.transition.Transitions.TRANSIT_START_RECENTS_TRANSITION import com.android.wm.shell.windowdecor.DragPositioningCallbackUtility Loading Loading @@ -118,6 +119,8 @@ class DesktopTilingWindowDecoration( var leftTaskResizingHelper: AppResizingHelper? = null var rightTaskResizingHelper: AppResizingHelper? = null var explodedViewTopTaskId: Int? = null @VisibleForTesting var isTilingManagerInitialised = false @VisibleForTesting var desktopTilingDividerWindowManager: DesktopTilingDividerWindowManager? = null Loading Loading @@ -518,6 +521,13 @@ class DesktopTilingWindowDecoration( desktopTilingDividerWindowManager?.showDividerBar(hiddenByOverviewAnimation) hiddenByOverviewAnimation = false } if (info.type == TRANSIT_END_RECENTS_TRANSITION) { explodedViewTopTaskId?.let { moveTiledPairToFront(taskId = it, isFocusedOnDisplay = true) } explodedViewTopTaskId = null } } private fun handleTaskBroughtToFront(taskId: Int) { Loading Loading @@ -721,6 +731,10 @@ class DesktopTilingWindowDecoration( } } fun onExplodedViewReorder(topTaskId: Int) { explodedViewTopTaskId = topTaskId } fun resetTilingSession(shouldPersistTilingData: Boolean = false) { logD("Resetting tiling session.") if (leftTaskResizingHelper != null) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/SnapEventHandler.kt +3 −0 Original line number Diff line number Diff line Loading @@ -71,4 +71,7 @@ interface SnapEventHandler { /** Notifies the snap event handler of a desk being removed. */ fun onDeskRemoved(deskId: Int) /** Notifies tiling of an exploded view reorder to prepare the tiling view for the event. */ fun notifyTilingOfExplodedViewReorder(deskId: Int, topTaskId: Int) } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +6 −2 Original line number Diff line number Diff line Loading @@ -5177,7 +5177,6 @@ class DesktopTasksController( userId = userId, enterReason = enterReason, ) // Put task with [taskIdToReorderToFront] to front. when (newTaskInFront) { is RunningTaskInfo -> { Loading @@ -5200,6 +5199,12 @@ class DesktopTasksController( } } // Exploded view is where tasks are exploded within a desktop on entering recents, // so if the user selects a tiled task to be in front, tiling should handle this // to bring all tiled tasks to front. if (taskIdToReorderToFront != INVALID_TASK_ID && taskIdToReorderToFront != null) { snapEventHandler.notifyTilingOfExplodedViewReorder(deskId, taskIdToReorderToFront) } val transitionType = transitionType(remoteTransition) val handler = remoteTransition?.let { Loading @@ -5209,7 +5214,6 @@ class DesktopTasksController( val transition = transitions.startTransition(transitionType, wct, handler) handler?.setTransition(transition) runOnTransitStart?.invoke(transition) // Replaced by |IDesktopTaskListener#onActiveDeskChanged|. if (!desktopState.enableMultipleDesktops) { desktopModeEnterExitTransitionListener?.onEnterDesktopModeTransitionStarted( Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +5 −0 Original line number Diff line number Diff line Loading @@ -1049,6 +1049,11 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, currentDragBounds); } @Override public void notifyTilingOfExplodedViewReorder(int deskId, int topTaskId) { mDesktopTilingDecorViewModel.onExplodedViewReorder(deskId, topTaskId); } @Override public void onDeskActivated(int deskId, int displayId) { if (mDesktopTilingDecorViewModel.tilingDeskActive(deskId)) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingDecorViewModel.kt +4 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,10 @@ class DesktopTilingDecorViewModel( tilingHandlerByUserAndDeskId[currentUserId]?.remove(deskId) } fun onExplodedViewReorder(deskId: Int, topTaskId: Int) { tilingHandlerByUserAndDeskId[currentUserId]?.get(deskId)?.onExplodedViewReorder(topTaskId) } fun getCurrentActiveDeskForDisplay(displayId: Int): Int? = desktopUserRepositories.current.getActiveDeskId(displayId) Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/DesktopTilingWindowDecoration.kt +14 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ import com.android.wm.shell.shared.desktopmode.DesktopState import com.android.wm.shell.sysui.ShellController import com.android.wm.shell.transition.FocusTransitionObserver import com.android.wm.shell.transition.Transitions import com.android.wm.shell.transition.Transitions.TRANSIT_END_RECENTS_TRANSITION import com.android.wm.shell.transition.Transitions.TRANSIT_MINIMIZE import com.android.wm.shell.transition.Transitions.TRANSIT_START_RECENTS_TRANSITION import com.android.wm.shell.windowdecor.DragPositioningCallbackUtility Loading Loading @@ -118,6 +119,8 @@ class DesktopTilingWindowDecoration( var leftTaskResizingHelper: AppResizingHelper? = null var rightTaskResizingHelper: AppResizingHelper? = null var explodedViewTopTaskId: Int? = null @VisibleForTesting var isTilingManagerInitialised = false @VisibleForTesting var desktopTilingDividerWindowManager: DesktopTilingDividerWindowManager? = null Loading Loading @@ -518,6 +521,13 @@ class DesktopTilingWindowDecoration( desktopTilingDividerWindowManager?.showDividerBar(hiddenByOverviewAnimation) hiddenByOverviewAnimation = false } if (info.type == TRANSIT_END_RECENTS_TRANSITION) { explodedViewTopTaskId?.let { moveTiledPairToFront(taskId = it, isFocusedOnDisplay = true) } explodedViewTopTaskId = null } } private fun handleTaskBroughtToFront(taskId: Int) { Loading Loading @@ -721,6 +731,10 @@ class DesktopTilingWindowDecoration( } } fun onExplodedViewReorder(topTaskId: Int) { explodedViewTopTaskId = topTaskId } fun resetTilingSession(shouldPersistTilingData: Boolean = false) { logD("Resetting tiling session.") if (leftTaskResizingHelper != null) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/tiling/SnapEventHandler.kt +3 −0 Original line number Diff line number Diff line Loading @@ -71,4 +71,7 @@ interface SnapEventHandler { /** Notifies the snap event handler of a desk being removed. */ fun onDeskRemoved(deskId: Int) /** Notifies tiling of an exploded view reorder to prepare the tiling view for the event. */ fun notifyTilingOfExplodedViewReorder(deskId: Int, topTaskId: Int) }