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
2022-10-07 15:11:09 +01:00
parent 82469ea23b
commit 0733ebd3c1
3 changed files with 26 additions and 26 deletions

View File

@@ -90,9 +90,9 @@ public final class RecentsViewStateController extends
// While animating into recents, update the visible task data as needed
builder.addOnFrameCallback(() -> mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL));
mRecentsView.updateEmptyMessage();
// 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) {
Log.d("b/238461210", "RecentsView#setStateWithAnimationInternal getCurrentPage(): "
Log.d("b/246283207", "RecentsView#setStateWithAnimationInternal getCurrentPage(): "
+ mRecentsView.getCurrentPage()
+ ", getScrollForPage(getCurrentPage())): "
+ mRecentsView.getScrollForPage(mRecentsView.getCurrentPage()));