Fix DesktopModeWindowDecor leak on last bubble removal.
This change fixes a performance regression (b/412782113) in the bubble cleanup process that caused desktop mode window decoration "leaks" during bubble removal. The issue particularly impacts the ShowMultipleBubblesAndSwitchMicrobenchmark test, showing regressions of over 1,700% in missed frames during SPLASHSCREEN_EXIT_ANIM. The problem occurs during the removal of the last bubble from the stack, where two window container transitions (WCT) are triggered in sequence: a TO_BACK transition followed by a CLOSE transition. By the time the TO_BACK transition occurs, the bubble is already removed from the bubble data, causing AppHandleAndHeaderVisibilityHelper to incorrectly allow desktop mode window decorations for the removed bubble task. This change eliminates the unnecessary TO_BACK transition when removing the last bubble from an empty stack, allowing the CLOSE transition to handle the task removal directly. This prevents the accumulation of desktop decorations and significantly improves performance metrics. Bug: 416655338 Bug: 408389476 Bug: 388630258 Flag: com.android.wm.shell.enable_create_any_bubble Flag: com.android.window.flags.exclude_task_from_recents Test: atest WMShellRobolectricTests:BubbleControllerTest Test: atest systemui-bubble-1-jank-suite \ --request-upload-result \ -- --enable-module-dynamic-download \ --module-arg systemui-bubble-1-jank-suite:strict-include-metric-filter:'perfetto_ft_systemui-missed_app_frames-mean' \ --test-arg com.android.tradefed.testtype.AndroidJUnitTest:class:android.platform.test.scenario.sysui.bubble.ShowMultipleBubblesAndSwitchMicrobenchmark http: //ab/I4940001039473788 (flag enabled, SPLASHSCREEN_EXIT_ANIM-counter_metrics-missed_app_frames-mean:0.04) Change-Id: Ia37433a8cd6c2cfb7187cb171e791de6e1b77122
Loading
Please register or sign in to comment