### Start Transient-Launch Transition Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/transitions.md Initiates a transient-launch transition using ActivityOptions and a WindowContainerTransaction. Use this when an activity may not have been started yet. ```kotlin val opts = ActivityOptions.makeBasic().setTransientLaunch() val wct = WindowContainerTransaction() wct.sendPendingIntent(pendingIntent, new Intent(), opts.toBundle()) transitions.startTransition(TRANSIT_OPEN, wct, ...) ``` -------------------------------- ### Basic Function Example Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/patterns/TEMPLATE.md Demonstrates a simple function structure. Use this as a template for new functions. ```kotlin fun someFunction() { // Use this code } ``` -------------------------------- ### Trace Shell Transition Starts and Finishes Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/debugging.md Enable tracing for the start and finish of new Window Manager transitions within the Shell. This is useful for understanding the transition lifecycle. A reboot is required after setting the properties, and logs can be monitored using 'adb logcat'. ```shell # Enabling adb shell setprop persist.wm.debug.start_shell_transition true adb shell setprop persist.wm.debug.finish_shell_transition true adb reboot adb logcat -s "ShellTransitions" ``` ```shell # Disabling adb shell setprop persist.wm.debug.start_shell_transition "" adb shell setprop persist.wm.debug.finish_shell_transition "" adb reboot ``` -------------------------------- ### View all windows in WM Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/debugging.md Execute `dumpsys window -a` to get detailed information about all windows managed by the WindowManager. Windows are listed from top to bottom in z-order. ```shell # All windows in WM adb shell dumpsys window -a ``` -------------------------------- ### Trace Activity Starts in App Process Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/debugging.md Enable tracing for activity starts within the application process. This is useful for debugging issues related to activity lifecycles or when activities are started via WindowContainerTransaction. A reboot is required after setting the property, and logs can be monitored using 'adb logcat'. ```shell # Enabling adb shell setprop persist.wm.debug.start_activity true adb reboot adb logcat -s "Instrumentation" ``` ```shell # Disabling adb shell setprop persist.wm.debug.start_activity "" adb reboot ``` -------------------------------- ### Enable WM_SHELL_INIT Protolog Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/changes.md Enable the WM_SHELL_INIT protolog group to verify component initialization at startup. This requires enabling the protolog and restarting the SystemUI process. ```shell adb shell wm logging enable-text WM_SHELL_INIT ``` ```shell adb shell kill `pid com.android.systemui` ``` ```shell adb logcat *:S WindowManagerShell ``` -------------------------------- ### Build with aidegen for Framework Changes Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/overview.md If making framework changes and using aidegen, include the appropriate directories to build the WindowManager-Shell and SystemUI components. ```shell # frameworks/base will include base/libs/WindowManager/Shell and base/packages/SystemUI aidegen frameworks/base \ vendor//packages/SystemUI \ ... ``` -------------------------------- ### LawnchairAppComponentImpl Initialization Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/src/main/generated/baselineProfiles/baseline-prof.txt Methods for initializing the Lawnchair application component with necessary dependencies. ```APIDOC ## LawnchairAppComponentImpl Initialization ### Description These methods are used to initialize the `LauncherAppComponentImpl` with required modules and context. ### Methods - `initialize(ThemeManagerModule themeManagerModule, Context context, String packageName, Boolean isDebug)`: Initializes the component with the provided theme manager module, context, package name, and debug flag. - `initialize2(ThemeManagerModule themeManagerModule, Context context, String packageName, Boolean isDebug)`: An alternative initialization method. - `initialize3(ThemeManagerModule themeManagerModule, Context context, String packageName, Boolean isDebug)`: Another alternative initialization method. - `initialize4(ThemeManagerModule themeManagerModule, Context context, String packageName, Boolean isDebug)`: A further alternative initialization method. ``` -------------------------------- ### Dump WMShell Service State Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/debugging.md Dump the state of the WMShell service. This is done as part of dumping the SystemUI service. Specify the WMShell service to get Shell-specific data. ```shell # Note: prior to 25Q2, you may need to use: # adb shell dumpsys activity service SystemUIService WMShell dump adb shell wm shell dump ``` -------------------------------- ### Build WindowManager-Shell Library Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/overview.md Build the WindowManager-Shell library directly. This is mainly useful for inspecting the contents of the library or verifying it builds. ```shell m WindowManager-Shell ``` -------------------------------- ### List Available Shell Commands Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/debugging.md List all available shell commands for the WMShell service. This helps in understanding the debugging and testing capabilities provided by shell commands. ```shell # Note: prior to 25Q2, you may need to use: # adb shell dumpsys activity service SystemUIService WMShell help adb shell wm shell help ``` -------------------------------- ### View WindowManager hierarchy Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/debugging.md Use the `dumpsys activity containers` command to quickly view the WindowManager hierarchy without a Winscope trace. The output lists containers from top to bottom in z-order. ```shell adb shell dumpsys activity containers ``` -------------------------------- ### Run WM Shell Unit Tests Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/testing.md Execute WM Shell unit tests from the command line. Ensure tests are located in the Shell/tests/unittest directory. ```shell atest WMShellUnitTests ``` -------------------------------- ### Run WM Shell Flicker Tests Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/testing.md Execute WM Shell flicker tests from the command line. These tests capture traces during execution. Different categories of tests are available. ```shell # Bubbles atest WMShellFlickerTestsBubbles ``` ```shell # PIP atest WMShellFlickerTestsPip1 atest WMShellFlickerTestsPip2 atest WMShellFlickerTestsPip3 atest WMShellFlickerTestsPipApps atest WMShellFlickerTestsPipAppsCSuite ``` ```shell # Splitscreen atest WMShellFlickerTestsSplitScreenGroup1 atest WMShellFlickerTestsSplitScreenGroup2 ``` ```shell # Other atest WMShellFlickerTestsOther ``` -------------------------------- ### Run CTS Pinned Stack Tests Source: https://github.com/lawnchairlauncher/lawnchair/blob/16-dev/wmshell/src/com/android/wm/shell/docs/testing.md Execute CTS tests for windowing features, such as Picture-in-Picture, from the command line. These tests ensure consistent behavior across OEMs. ```shell atest PinnedStackTests ```