From d8cc458867b1cf8004c8877fde8594a407e4694f Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 26 Apr 2021 14:42:44 -0400 Subject: [PATCH] Remove reliance on surface to update depth - Also no longer resets depth on surface change, as depth is independent from blur. This fixes the bug where depth is not accurately reflected. Bug: 185680609 Bug: 185189176 Test: launch app and swipe home multiple times launch app and back gesture to home Change-Id: I5e2f4ce08b8bf84b7356fbd080ae732875c5e04e --- .../launcher3/statehandlers/DepthController.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index 249ef3a3b0..59d0afa47f 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -158,11 +158,7 @@ public class DepthController implements StateHandler, * Sets the specified app target surface to apply the blur to. */ public void setSurfaceToApp(RemoteAnimationTargetCompat target) { - if (target != null) { - setSurface(target.leash); - } else { - setActivityStarted(mLauncher.isStarted()); - } + setSurface(target == null ? null : target.leash); } private void setSurface(SurfaceControlCompat surface) { @@ -170,9 +166,6 @@ public class DepthController implements StateHandler, mSurface = surface; if (surface != null) { setDepth(mDepth); - } else { - // If there is no surface, then reset the ratio - setDepth(0f); } } } @@ -192,8 +185,7 @@ public class DepthController implements StateHandler, @Override public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config, PendingAnimation animation) { - if (mSurface == null - || config.hasAnimationFlag(SKIP_DEPTH_CONTROLLER) + if (config.hasAnimationFlag(SKIP_DEPTH_CONTROLLER) || mIgnoreStateChangesDuringMultiWindowAnimation) { return; }