Tighten up loading of visible task data

- Certain animations can run after the launcher state has changed,
  triggering loading of task data even when the overview state is not
  visible. Only allow re/loading of this data when we are in the overview
  state.

Bug: 76162466
Change-Id: Ie1f492ef712ea4aa2db6f2e1bc7ba4390742875b
This commit is contained in:
Winson Chung
2018-05-22 14:05:15 -07:00
parent 98913d0c95
commit 15067109b1

View File

@@ -582,6 +582,11 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
* and unloads the associated task data for tasks that are no longer visible.
*/
public void loadVisibleTaskData() {
if (!mOverviewStateEnabled) {
// Skip loading visible task data if we've already left the overview state
return;
}
RecentsTaskLoader loader = mModel.getRecentsTaskLoader();
int centerPageIndex = getPageNearestToCenterOfScreen();
int lower = Math.max(0, centerPageIndex - 2);