Run setCurrentPage in applyLoadPlan after scroll initialized

- Also combined the 2 setCurrentPage call in applyLoadPlan into 1
- Otherwise setCurrentTask may set to page 1 unexpectedly due to page 0's scroll being invalid and out of range

Bug: 246283207
Bug: 238461210
Test: Split screen with 2 apps, click back, go to overview again, should snap to focsued task
Change-Id: I3b57655c810668fe244659437fbd4a745ca02d21
This commit is contained in:
Alex Chau committed 2022-10-11 12:36:35 +01:00
1 parent 82469ea23b
commit 0733ebd3c1
3 files changed
+26 -26

No files matched your search

+2 -2
View File
@@ -772,9 +772,9 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
}
if (mScroller.isFinished() && pageScrollChanged) {
// TODO(b/238461210): Remove logging once root cause of flake detected.
// TODO(b/246283207): Remove logging once root cause of flake detected.
if (Utilities.IS_RUNNING_IN_TEST_HARNESS && !(this instanceof Workspace)) {
Log.d("b/238461210", this.getClass().getSimpleName() + "#onLayout() -> "
Log.d("b/246283207", this.getClass().getSimpleName() + "#onLayout() -> "
+ "if(mScroller.isFinished() && pageScrollChanged) -> getNextPage(): "
+ getNextPage() + ", getScrollForPage(getNextPage()): "
+ getScrollForPage(getNextPage()));