From d4bd12a763c1d9c9a8a6beb74222317b633df812 Mon Sep 17 00:00:00 2001 From: vinayjoglekar Date: Mon, 12 May 2025 18:03:13 +0100 Subject: [PATCH] Apply correct theme when launcher restarts 1. initialize DepthController before applyStyle() 2. initialize mBlurEnabled to correct value based on mCrossWindowBlursEnabled and mPauseBlurs. Fix: 416687465 Test: Restart launcher and go to overview both from app and home. Flag: com.android.launcher3.enable_overview_background_wallpaper_blur Change-Id: I018d25b66d925f201449400fc6bbb6a238a0f531 --- .../launcher3/uioverrides/QuickstepLauncher.java | 5 +++-- .../android/quickstep/util/BaseDepthController.java | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 7fb1a80734..efbbf1b6d5 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -301,8 +301,9 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, @Override protected void setupViews() { - getTheme().applyStyle(getOverviewBlurStyleResId(), true); getAppWidgetHolder().setOnViewCreationCallback(new QuickstepInteractionHandler(this)); + mDepthController = new DepthController(this); + getTheme().applyStyle(getOverviewBlurStyleResId(), true); super.setupViews(); mActionsView = findViewById(R.id.overview_actions_view); @@ -332,7 +333,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, mAppTransitionManager.registerRemoteTransitions(); mTISBindHelper = new TISBindHelper(this, this::onTISConnected); - mDepthController = new DepthController(this); + if (DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(this)) { mSplitSelectStateController.initSplitFromDesktopController(this); } diff --git a/quickstep/src/com/android/quickstep/util/BaseDepthController.java b/quickstep/src/com/android/quickstep/util/BaseDepthController.java index 5c84e1a466..1d85beffb2 100644 --- a/quickstep/src/com/android/quickstep/util/BaseDepthController.java +++ b/quickstep/src/com/android/quickstep/util/BaseDepthController.java @@ -28,6 +28,7 @@ import android.os.Trace; import android.util.FloatProperty; import android.util.Log; import android.view.AttachedSurfaceControl; +import android.view.CrossWindowBlurListeners; import android.view.SurfaceControl; import androidx.annotation.NonNull; @@ -122,9 +123,11 @@ public class BaseDepthController { public BaseDepthController(Launcher activity) { mLauncher = activity; if (Flags.allAppsBlur() || enableOverviewBackgroundWallpaperBlur()) { + mCrossWindowBlursEnabled = + CrossWindowBlurListeners.getInstance().isCrossWindowBlurEnabled(); + mBlursEnabled = calculateBlursEnabled(); mMaxBlurRadius = activity.getResources().getDimensionPixelSize( R.dimen.max_depth_blur_radius_enhanced); - mLauncher.updateBlurStyle(); } else { mMaxBlurRadius = activity.getResources().getInteger(R.integer.max_depth_blur_radius); } @@ -157,7 +160,7 @@ public class BaseDepthController { } protected final void onBlurChange() { - boolean blursEnabled = mCrossWindowBlursEnabled && !mPauseBlurs; + boolean blursEnabled = calculateBlursEnabled(); if (mBlursEnabled == blursEnabled) { return; } @@ -412,4 +415,8 @@ public class BaseDepthController { private SurfaceControl.Transaction createTransaction() { return new SurfaceControl.Transaction(); } + + private Boolean calculateBlursEnabled() { + return mCrossWindowBlursEnabled && !mPauseBlurs; + } }