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); + } }); }