Merge "Apply correct theme when launcher restarts" into main

This commit is contained in:
Vinay Joglekar
2025-05-14 04:56:27 -07:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 4 deletions
@@ -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);
}
@@ -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;
}
}