Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt +42 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.internal.util.FrameworkStatsLog import com.android.wm.shell.EventLogTags import com.android.wm.shell.common.DisplayController import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource import java.security.SecureRandom import java.util.Random import java.util.concurrent.atomic.AtomicInteger Loading Loading @@ -461,6 +462,23 @@ class DesktopModeEventLogger { } } /** * Returns corresponding desktop mode enter [EnterReason] for a * [DesktopModeTransitionSource]. */ @JvmStatic fun DesktopModeTransitionSource.getEnterReason(): EnterReason = when (this) { DesktopModeTransitionSource.APP_HANDLE_MENU_BUTTON -> EnterReason.APP_HANDLE_MENU_BUTTON DesktopModeTransitionSource.OVERVIEW_TASK_MENU -> EnterReason.OVERVIEW_TASK_MENU DesktopModeTransitionSource.KEYBOARD_SHORTCUT -> EnterReason.KEYBOARD_SHORTCUT_ENTER DesktopModeTransitionSource.RECENTS -> EnterReason.RECENTS DesktopModeTransitionSource.TASK_DRAG -> EnterReason.APP_HANDLE_DRAG DesktopModeTransitionSource.ADB_COMMAND -> EnterReason.ADB_COMMAND else -> EnterReason.UNKNOWN_ENTER } // Default value used when the task was not minimized. @VisibleForTesting const val UNSET_MINIMIZE_REASON = Loading Loading @@ -551,6 +569,16 @@ class DesktopModeEventLogger { OVERVIEW_TASK_MENU( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__OVERVIEW_TASK_MENU ), ADB_COMMAND(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__ADB_COMMAND), RECENTS(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__RECENTS), EXIT_PIP(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__EXIT_PIP), DISPLAY_CONNECT( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__DISPLAY_CONNECT ), DESK_REPARENT(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__DESK_REPARENT), APP_SELF_REPOSITION( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__APP_SELF_REPOSITION ), } /** Loading @@ -575,6 +603,20 @@ class DesktopModeEventLogger { TASK_MOVED_TO_BACK( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__TASK_MOVED_TO_BACK ), DISPLAY_DISCONNECTED( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__DISPLAY_DISCONNECTED ), FULLSCREEN_LAUNCH( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__FULLSCREEN_LAUNCH ), ADB_COMMAND_EXIT( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__ADB_COMMAND_EXIT ), TASK_MOVED_FROM_DESK( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__TASK_MOVED_FROM_DESK ), RECENTS_DISMISS(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__RECENTS_DISMISS), ENTER_PIP(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__ENTER_PIP), } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeKeyGestureHandler.kt +7 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.internal.protolog.ProtoLog import com.android.wm.shell.ShellTaskOrganizer import com.android.wm.shell.common.DisplayController import com.android.wm.shell.common.ShellExecutor import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.EnterReason import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.MinimizeReason import com.android.wm.shell.desktopmode.common.ToggleTaskSizeInteraction import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE Loading Loading @@ -75,7 +76,12 @@ class DesktopModeKeyGestureHandler( logV("Key gesture MOVE_TO_NEXT_DISPLAY is handled") getGloballyFocusedTaskToMoveToNextDisplay()?.let { mainExecutor.execute { desktopTasksController.get().moveToNextDesktopDisplay(it.taskId) desktopTasksController .get() .moveToNextDesktopDisplay( it.taskId, EnterReason.KEYBOARD_SHORTCUT_ENTER, ) } } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeShellCommandHandler.kt +6 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,10 @@ package com.android.wm.shell.desktopmode import android.app.ActivityTaskManager.INVALID_TASK_ID import android.window.DesktopExperienceFlags import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.EnterReason import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.ExitReason import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.UnminimizeReason import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource.ADB_COMMAND import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource.UNKNOWN import com.android.wm.shell.sysui.ShellCommandHandler Loading Loading @@ -106,7 +109,7 @@ class DesktopModeShellCommandHandler( pw.println("Error: no appropriate task found") return false } controller.moveToNextDisplay(taskId) controller.moveToNextDisplay(taskId, enterReason = EnterReason.ADB_COMMAND) return true } Loading Loading @@ -148,7 +151,7 @@ class DesktopModeShellCommandHandler( pw.println("Error: desk id should be an integer") return false } controller.activateDesk(deskId) controller.activateDesk(deskId, transitionSource = DesktopModeTransitionSource.ADB_COMMAND) return true } Loading @@ -169,7 +172,7 @@ class DesktopModeShellCommandHandler( pw.println("Error: desk id should be an integer") return false } controller.removeDesk(deskId) controller.removeDesk(deskId, exitReason = ExitReason.ADB_COMMAND_EXIT) return true } Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopPipTransitionController.kt +4 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import android.window.WindowContainerTransaction import com.android.internal.protolog.ProtoLog import com.android.wm.shell.ShellTaskOrganizer import com.android.wm.shell.common.pip.PipDesktopState import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.EnterReason import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.ExitReason import com.android.wm.shell.desktopmode.data.DesktopRepository import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE Loading Loading @@ -205,6 +207,7 @@ class DesktopPipTransitionController( wct = wct, newTask = if (shouldAddParentToDesk) parentTask!! else runningTaskInfo, displayId = displayId, enterReason = EnterReason.EXIT_PIP, ) } Loading Loading @@ -315,6 +318,7 @@ class DesktopPipTransitionController( displayId = displayId, willExitDesktop = true, removingLastTaskId = taskId, exitReason = ExitReason.ENTER_PIP, ) desktopExitRunnable?.invoke(transition) } Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +132 −26 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt +42 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.internal.util.FrameworkStatsLog import com.android.wm.shell.EventLogTags import com.android.wm.shell.common.DisplayController import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource import java.security.SecureRandom import java.util.Random import java.util.concurrent.atomic.AtomicInteger Loading Loading @@ -461,6 +462,23 @@ class DesktopModeEventLogger { } } /** * Returns corresponding desktop mode enter [EnterReason] for a * [DesktopModeTransitionSource]. */ @JvmStatic fun DesktopModeTransitionSource.getEnterReason(): EnterReason = when (this) { DesktopModeTransitionSource.APP_HANDLE_MENU_BUTTON -> EnterReason.APP_HANDLE_MENU_BUTTON DesktopModeTransitionSource.OVERVIEW_TASK_MENU -> EnterReason.OVERVIEW_TASK_MENU DesktopModeTransitionSource.KEYBOARD_SHORTCUT -> EnterReason.KEYBOARD_SHORTCUT_ENTER DesktopModeTransitionSource.RECENTS -> EnterReason.RECENTS DesktopModeTransitionSource.TASK_DRAG -> EnterReason.APP_HANDLE_DRAG DesktopModeTransitionSource.ADB_COMMAND -> EnterReason.ADB_COMMAND else -> EnterReason.UNKNOWN_ENTER } // Default value used when the task was not minimized. @VisibleForTesting const val UNSET_MINIMIZE_REASON = Loading Loading @@ -551,6 +569,16 @@ class DesktopModeEventLogger { OVERVIEW_TASK_MENU( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__OVERVIEW_TASK_MENU ), ADB_COMMAND(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__ADB_COMMAND), RECENTS(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__RECENTS), EXIT_PIP(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__EXIT_PIP), DISPLAY_CONNECT( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__DISPLAY_CONNECT ), DESK_REPARENT(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__DESK_REPARENT), APP_SELF_REPOSITION( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__ENTER_REASON__APP_SELF_REPOSITION ), } /** Loading @@ -575,6 +603,20 @@ class DesktopModeEventLogger { TASK_MOVED_TO_BACK( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__TASK_MOVED_TO_BACK ), DISPLAY_DISCONNECTED( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__DISPLAY_DISCONNECTED ), FULLSCREEN_LAUNCH( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__FULLSCREEN_LAUNCH ), ADB_COMMAND_EXIT( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__ADB_COMMAND_EXIT ), TASK_MOVED_FROM_DESK( FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__TASK_MOVED_FROM_DESK ), RECENTS_DISMISS(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__RECENTS_DISMISS), ENTER_PIP(FrameworkStatsLog.DESKTOP_MODE_UICHANGED__EXIT_REASON__ENTER_PIP), } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeKeyGestureHandler.kt +7 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.internal.protolog.ProtoLog import com.android.wm.shell.ShellTaskOrganizer import com.android.wm.shell.common.DisplayController import com.android.wm.shell.common.ShellExecutor import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.EnterReason import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.MinimizeReason import com.android.wm.shell.desktopmode.common.ToggleTaskSizeInteraction import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE Loading Loading @@ -75,7 +76,12 @@ class DesktopModeKeyGestureHandler( logV("Key gesture MOVE_TO_NEXT_DISPLAY is handled") getGloballyFocusedTaskToMoveToNextDisplay()?.let { mainExecutor.execute { desktopTasksController.get().moveToNextDesktopDisplay(it.taskId) desktopTasksController .get() .moveToNextDesktopDisplay( it.taskId, EnterReason.KEYBOARD_SHORTCUT_ENTER, ) } } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeShellCommandHandler.kt +6 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,10 @@ package com.android.wm.shell.desktopmode import android.app.ActivityTaskManager.INVALID_TASK_ID import android.window.DesktopExperienceFlags import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.EnterReason import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.ExitReason import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.UnminimizeReason import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource.ADB_COMMAND import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource.UNKNOWN import com.android.wm.shell.sysui.ShellCommandHandler Loading Loading @@ -106,7 +109,7 @@ class DesktopModeShellCommandHandler( pw.println("Error: no appropriate task found") return false } controller.moveToNextDisplay(taskId) controller.moveToNextDisplay(taskId, enterReason = EnterReason.ADB_COMMAND) return true } Loading Loading @@ -148,7 +151,7 @@ class DesktopModeShellCommandHandler( pw.println("Error: desk id should be an integer") return false } controller.activateDesk(deskId) controller.activateDesk(deskId, transitionSource = DesktopModeTransitionSource.ADB_COMMAND) return true } Loading @@ -169,7 +172,7 @@ class DesktopModeShellCommandHandler( pw.println("Error: desk id should be an integer") return false } controller.removeDesk(deskId) controller.removeDesk(deskId, exitReason = ExitReason.ADB_COMMAND_EXIT) return true } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopPipTransitionController.kt +4 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import android.window.WindowContainerTransaction import com.android.internal.protolog.ProtoLog import com.android.wm.shell.ShellTaskOrganizer import com.android.wm.shell.common.pip.PipDesktopState import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.EnterReason import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.ExitReason import com.android.wm.shell.desktopmode.data.DesktopRepository import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE Loading Loading @@ -205,6 +207,7 @@ class DesktopPipTransitionController( wct = wct, newTask = if (shouldAddParentToDesk) parentTask!! else runningTaskInfo, displayId = displayId, enterReason = EnterReason.EXIT_PIP, ) } Loading Loading @@ -315,6 +318,7 @@ class DesktopPipTransitionController( displayId = displayId, willExitDesktop = true, removingLastTaskId = taskId, exitReason = ExitReason.ENTER_PIP, ) desktopExitRunnable?.invoke(transition) } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +132 −26 File changed.Preview size limit exceeded, changes collapsed. Show changes