From d905645f1e6c2515dafb964a577f1814a1c67f93 Mon Sep 17 00:00:00 2001 From: vinayjoglekar Date: Thu, 3 Apr 2025 16:57:53 +0100 Subject: [PATCH] Fix blur flash while moving from live tiles to static. Fix : 406231674 Test: Manual. Dismiss live tile from Overview. Long press on live tile to invoke AiAi. Flag: com.android.launcher3.enable_overview_background_wallpaper_blur Change-Id: Ibc4c472f9c26862a4dcf0993ab487a8e52062bcf --- .../quickstep/util/BaseDepthController.java | 23 +++++++++++-------- .../android/quickstep/views/RecentsView.java | 3 +++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/BaseDepthController.java b/quickstep/src/com/android/quickstep/util/BaseDepthController.java index 1a896ff49d..e85506c652 100644 --- a/quickstep/src/com/android/quickstep/util/BaseDepthController.java +++ b/quickstep/src/com/android/quickstep/util/BaseDepthController.java @@ -146,10 +146,11 @@ public class BaseDepthController { protected void onInvalidSurface() { } protected void applyDepthAndBlur() { - applyDepthAndBlur(createTransaction()); + applyDepthAndBlur(createTransaction(), /* applyImmediately */ false); } - protected void applyDepthAndBlur(SurfaceControl.Transaction transaction) { + protected void applyDepthAndBlur(SurfaceControl.Transaction transaction, + boolean applyImmediately) { try (transaction) { float depth = mDepth; IBinder windowToken = mLauncher.getRootView().getWindowToken(); @@ -208,10 +209,14 @@ public class BaseDepthController { mInEarlyWakeUp = false; } - AttachedSurfaceControl rootSurfaceControl = - mLauncher.getRootView().getRootSurfaceControl(); - if (rootSurfaceControl != null) { - rootSurfaceControl.applyTransactionOnDraw(transaction); + if (applyImmediately) { + transaction.apply(); + } else { + AttachedSurfaceControl rootSurfaceControl = + mLauncher.getRootView().getRootSurfaceControl(); + if (rootSurfaceControl != null) { + rootSurfaceControl.applyTransactionOnDraw(transaction); + } } } @@ -254,11 +259,12 @@ public class BaseDepthController { *

*/ public void setBaseSurfaceOverride(@Nullable SurfaceControl baseSurfaceOverride) { + boolean applyImmediately = mBaseSurfaceOverride != null && baseSurfaceOverride == null; this.mBaseSurfaceOverride = baseSurfaceOverride; Log.d(TAG, "setBaseSurfaceOverride: applying blur behind leash " + baseSurfaceOverride); SurfaceControl.Transaction transaction = createTransaction(); setupBlurSurface(transaction); - applyDepthAndBlur(transaction); + applyDepthAndBlur(transaction, applyImmediately); } private void setupBlurSurface(SurfaceControl.Transaction transaction) { @@ -277,7 +283,6 @@ public class BaseDepthController { transaction.reparent(mBlurSurface, mBaseSurface); Log.d(TAG, "setupBlurSurface: reparenting " + mBlurSurface + " to " + mBaseSurface); - transaction.setRelativeLayer(mBlurSurface, mBaseSurfaceOverride, -1); Log.d(TAG, "setupBlurSurface: relayering to leash " + mBaseSurfaceOverride); } else { @@ -301,7 +306,7 @@ public class BaseDepthController { if (enableOverviewBackgroundWallpaperBlur()) { setupBlurSurface(transaction); } - applyDepthAndBlur(transaction); + applyDepthAndBlur(transaction, /* applyImmediately */ false); } } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 1476613575..20fec8109d 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -5997,6 +5997,9 @@ public abstract class RecentsView< tx, null /* overlay */); } } + if (enableOverviewBackgroundWallpaperBlur()) { + mBlurUtils.setDrawLiveTileBelowRecents(false); + } mRecentsAnimationController.finish(toRecents, () -> { if (onFinishComplete != null) { onFinishComplete.run();