From 3945f028de26c07a8a1dd36ad4438280d59b7359 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Thu, 9 Jun 2022 14:23:17 -0700 Subject: [PATCH] Revert line that could wrongly initialize RecentsView scroll Test: open a random app that hasn't been opened in a while, touch down on nav handle and see if RecentsView scrolls partially or fully offscreen; repeat 20 times to be sure Bug: 233112195 Fixes: 235369468 Change-Id: Ie8b3dbea7c4826af037edf22360946105ab22134 --- src/com/android/launcher3/PagedView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 73be5beb2c..cba0b7d709 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -1187,7 +1187,9 @@ public abstract class PagedView extends ViewGrou } public int getScrollForPage(int index) { - if (!pageScrollsInitialized() || index >= mPageScrolls.length || index < 0) { + // TODO(b/233112195): Use !pageScrollsInitialized() instead of mPageScrolls == null, once we + // root cause where we should be using runOnPageScrollsInitialized(). + if (mPageScrolls == null || index >= mPageScrolls.length || index < 0) { return 0; } else { return mPageScrolls[index];