From 42405b2fa35322a6883633fbe3eed9fa92da2a76 Mon Sep 17 00:00:00 2001 From: Randy Pfohl Date: Thu, 20 Feb 2025 23:45:06 +0000 Subject: [PATCH] Enabling secondary deviceprofile creation in windowcontext Test: Built and ran locally Flag: com.android.launcher3.enable_fallback_overview_in_window com.android.launcher3.enable_launcher_overview_in_window Change-Id: Iafb75840c4acadb35eb9e89810e9de61bbeda326 --- .../quickstep/fallback/window/RecentsWindowContext.kt | 6 +++++- .../quickstep/fallback/window/RecentsWindowManager.kt | 6 ------ quickstep/src/com/android/quickstep/views/RecentsView.java | 4 ---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowContext.kt b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowContext.kt index cd4813631d..9a408ad1d4 100644 --- a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowContext.kt +++ b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowContext.kt @@ -19,6 +19,7 @@ package com.android.quickstep.fallback.window import android.content.Context import android.graphics.PixelFormat import android.view.ContextThemeWrapper +import android.view.Display import android.view.ViewGroup import android.view.WindowManager import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS @@ -62,7 +63,10 @@ open class RecentsWindowContext(windowContext: Context, wallpaperColorHints: Int } fun initDeviceProfile() { - deviceProfile = InvariantDeviceProfile.INSTANCE[this].getDeviceProfile(this) + deviceProfile = + if (displayId == Display.DEFAULT_DISPLAY) + InvariantDeviceProfile.INSTANCE[this].getDeviceProfile(this) + else InvariantDeviceProfile.INSTANCE[this].createDeviceProfileForSecondaryDisplay(this) } override fun getDeviceProfile(): DeviceProfile { diff --git a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt index 1f4961afe3..6a13927e07 100644 --- a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt +++ b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt @@ -81,7 +81,6 @@ import com.android.quickstep.views.RecentsViewContainer import com.android.systemui.shared.recents.model.ThumbnailData import com.android.systemui.shared.system.TaskStackChangeListener import com.android.systemui.shared.system.TaskStackChangeListeners -import java.util.function.Predicate /** * Class that will manage RecentsView lifecycle within a window and interface correctly where @@ -135,7 +134,6 @@ class RecentsWindowManager(context: Context, wallpaperColorHints: Int) : // Callback array that corresponds to events defined in @ActivityEvent private val eventCallbacks = listOf(RunnableList(), RunnableList(), RunnableList(), RunnableList()) - private var onInitListener: Predicate? = null private val animationToHomeFactory = RemoteAnimationFactory { @@ -336,10 +334,6 @@ class RecentsWindowManager(context: Context, wallpaperColorHints: Int) : return taskbarUIController } - fun registerInitListener(onInitListener: Predicate) { - this.onInitListener = onInitListener - } - override fun collectStateHandlers(out: MutableList>?) { out!!.add(FallbackRecentsStateController(this)) } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 44bf82c7b8..fe6d2df0fd 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -144,7 +144,6 @@ import com.android.launcher3.BaseActivity.MultiWindowModeChangedListener; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Flags; import com.android.launcher3.Insettable; -import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.PagedView; import com.android.launcher3.R; import com.android.launcher3.Utilities; @@ -574,8 +573,6 @@ public abstract class RecentsView< // Keeps track of the previously known visible tasks for purposes of loading/unloading task data private final SparseBooleanArray mHasVisibleTaskData = new SparseBooleanArray(); - private final InvariantDeviceProfile mIdp; - /** * Getting views should be done via {@link #getTaskViewFromPool(int)} */ @@ -912,7 +909,6 @@ public abstract class RecentsView< mFastFlingVelocity = getResources() .getDimensionPixelSize(R.dimen.recents_fast_fling_velocity); mModel = RecentsModel.INSTANCE.get(context); - mIdp = InvariantDeviceProfile.INSTANCE.get(context); mClearAllButton = (ClearAllButton) LayoutInflater.from(context) .inflate(R.layout.overview_clear_all_button, this, false);