From fd04f702d9e3da66ee0dc50173153254cbd1dfca Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 16 Apr 2020 18:06:19 -0700 Subject: [PATCH] Fixing crash when emptyView gets added twice Bug: 152129003 Change-Id: Id86279ace164453d0126773af89e3c9309d40202 --- .../src/com/android/quickstep/views/RecentsView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index a18f7bae05..4fd836d7f1 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -1057,7 +1057,7 @@ public abstract class RecentsView extends PagedView impl */ public void showCurrentTask(int runningTaskId) { if (getTaskView(runningTaskId) == null) { - boolean wasEmpty = getTaskViewCount() == 0; + boolean wasEmpty = getChildCount() == 0; // Add an empty view for now until the task plan is loaded and applied final TaskView taskView = mTaskViewPool.getView(); addView(taskView, mTaskViewStartIndex);