From 52909d0b5ff4bbb44586ebc2cf770a8650c6c607 Mon Sep 17 00:00:00 2001 From: Nicolo' Mazzucato Date: Thu, 15 Sep 2022 08:49:38 +0000 Subject: [PATCH] Fix taskbar instrumentation crash This was crashing when there were no views in the taskbar. Now, we're using getDragLayer, that will be always there. Bug: 245690391 Test: TaskbarExpandCollapse Change-Id: I4475adb0c6c425fca54af02bb071ed3e5f42d927 --- .../launcher3/taskbar/TaskbarStashController.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index d60bf8c896..9927f4b180 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -49,8 +49,6 @@ import com.android.quickstep.AnimatedFloat; import com.android.quickstep.SystemUiProxy; import java.io.PrintWriter; -import java.util.Arrays; -import java.util.Optional; import java.util.StringJoiner; import java.util.function.IntPredicate; @@ -546,13 +544,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } private void addJankMonitorListener(AnimatorSet animator, boolean expanding) { - Optional optionalView = - Arrays.stream(mControllers.taskbarViewController.getIconViews()).findFirst(); - if (optionalView.isEmpty()) { - Log.wtf(TAG, "No views to start Interaction jank monitor with.", new Exception()); - return; - } - View v = optionalView.get(); + View v = mControllers.taskbarActivityContext.getDragLayer(); int action = expanding ? InteractionJankMonitor.CUJ_TASKBAR_EXPAND : InteractionJankMonitor.CUJ_TASKBAR_COLLAPSE; animator.addListener(new AnimatorListenerAdapter() {