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
This commit is contained in:
Nicolo' Mazzucato
2022-09-15 08:49:38 +00:00
parent c528e7e818
commit 52909d0b5f

View File

@@ -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<View> 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() {