Merge "Fix TaskView bind and orientation state called multiple times" into udc-qpr-dev

This commit is contained in:
Jordan Silva
2023-05-24 23:28:39 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 2 deletions
@@ -1631,6 +1631,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
int[] runningTaskId = getTaskIdsForTaskViewId(mRunningTaskViewId);
int[] focusedTaskId = getTaskIdsForTaskViewId(mFocusedTaskViewId);
// Reset the focused task to avoiding initializing TaskViews layout as focused task during
// binding. The focused task view will be updated after all the TaskViews are bound.
mFocusedTaskViewId = INVALID_TASK_ID;
// Removing views sets the currentPage to 0, so we save this and restore it after
// the new set of views are added
int previousCurrentPage = mCurrentPage;
@@ -1737,7 +1741,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mFocusedTaskViewId = newFocusedTaskView != null && !ENABLE_GRID_ONLY_OVERVIEW.get()
? newFocusedTaskView.getTaskViewId() : INVALID_TASK_ID;
updateTaskSize();
updateChildTaskOrientations();
if (newFocusedTaskView != null) {
newFocusedTaskView.setOrientationState(mOrientationState);
}
TaskView newRunningTaskView = null;
if (hasAnyValidTaskIds(runningTaskId)) {
@@ -580,7 +580,6 @@ public class TaskView extends FrameLayout implements Reusable {
mIconView, STAGE_POSITION_UNDEFINED);
mSnapshotView.bind(task);
setOrientationState(orientedState);
mDigitalWellBeingToast.initialize(mTask);
}
/**