diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 6fb00a51d1..13e11aac22 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -298,8 +298,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); @@ -329,7 +330,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; + } }