From 408b1e01031c2c59f437ecb9abe82fd7002b28cd Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Mon, 23 Sep 2024 16:57:23 -0700 Subject: [PATCH] Cancel TASKBAR_COLLAPSE/EXPAND CUJ tracking when the stash animation is cancelled Bug: 362713428 Test: manual Flag: EXEMPT bugfix Change-Id: Ib09a26056ed0d4bae64566eed92279241dd84a90 --- .../launcher3/taskbar/TaskbarStashController.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 7624afb440..293be4570b 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -62,6 +62,7 @@ import com.android.launcher3.Alarm; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.anim.AnimatedFloat; +import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorListeners; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.MultiPropertyFactory.MultiProperty; @@ -968,7 +969,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } int action = expanding ? InteractionJankMonitor.CUJ_TASKBAR_EXPAND : InteractionJankMonitor.CUJ_TASKBAR_COLLAPSE; - animator.addListener(new AnimatorListenerAdapter() { + animator.addListener(new AnimationSuccessListener() { @Override public void onAnimationStart(@NonNull Animator animation) { final Configuration.Builder builder = @@ -980,9 +981,16 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } @Override - public void onAnimationEnd(@NonNull Animator animation) { + public void onAnimationSuccess(@NonNull Animator animator) { InteractionJankMonitor.getInstance().end(action); } + + @Override + public void onAnimationCancel(@NonNull Animator animation) { + super.onAnimationCancel(animation); + + InteractionJankMonitor.getInstance().cancel(action); + } }); }