From 20c8e175536b524a72db3854b56ab7abbfc6e504 Mon Sep 17 00:00:00 2001 From: Will Osborn Date: Wed, 28 May 2025 09:16:51 +0000 Subject: [PATCH] Only cleanup DEFAULT_DISPLAY WindowManager on new Intent Bug: 418915817 Flag: com.android.launcher3.enable_overview_on_connected_displays Test: locally tested on comet Change-Id: Iea4f56de63736502b3c81d0e7867229fcf28b276 --- .../launcher3/uioverrides/QuickstepLauncher.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 13d6dc43fe..aa5bc36b5e 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -17,6 +17,7 @@ package com.android.launcher3.uioverrides; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.os.Trace.TRACE_TAG_APP; +import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE; import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED; import static android.window.DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY; @@ -88,7 +89,6 @@ import android.os.Trace; import android.os.UserHandle; import android.text.TextUtils; import android.util.AttributeSet; -import android.view.Display; import android.view.HapticFeedbackConstants; import android.view.KeyEvent; import android.view.View; @@ -105,7 +105,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; -import com.android.app.displaylib.PerDisplayRepository; import com.android.app.viewcapture.ViewCaptureFactory; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; @@ -887,10 +886,11 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, overviewCommandHelper.clearPendingCommands(); } if (RecentsWindowFlags.getEnableOverviewInWindow() && !intentHasGnc) { - PerDisplayRepository recentsWindowManagerRepository = - RecentsWindowManager.REPOSITORY_INSTANCE.get(this); - recentsWindowManagerRepository.forEach( - /* createIfAbsent= */ true, RecentsWindowManager::cleanupRecentsWindow); + RecentsWindowManager defaultRecentsWindowManager = + RecentsWindowManager.REPOSITORY_INSTANCE.get(this).get(DEFAULT_DISPLAY); + if (defaultRecentsWindowManager != null) { + defaultRecentsWindowManager.cleanupRecentsWindow(); + } } } @@ -1282,7 +1282,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, } activityOptions.options.setLaunchDisplayId( (v != null && v.getDisplay() != null) ? v.getDisplay().getDisplayId() - : Display.DEFAULT_DISPLAY); + : DEFAULT_DISPLAY); activityOptions.options.setPendingIntentBackgroundActivityStartMode( ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED); return activityOptions;