diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index f8a9feffad..0a79f8a426 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; @@ -888,10 +887,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(); + } } } @@ -1290,7 +1290,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;