Unloading thumbnails from task views once recents is hidden

- Re-enabling the high res thumbnail loader, ensuring that we clean up
  the visible recent tasks when the associated views are removed
- When the recents state is re-entered, we will trigger the loading of
  the data anew (which will usually just fetch data from the existing
  cache if launcher was not stopped)

Bug: 74537246
Change-Id: I9cd69015461e1de34b4b65faeb9adb8aebd1dd3d
This commit is contained in:
Winson Chung committed 2018-03-13 20:47:36 +00:00
1 parent fad58c8159
commit c7c5158916
4 files changed
+59 -21

No files matched your search

@@ -210,13 +210,13 @@ public class RecentsModel extends TaskStackChangeListener {
public void onStart() {
mRecentsTaskLoader.startLoader(mContext);
// mRecentsTaskLoader.getHighResThumbnailLoader().setVisible(true);
mRecentsTaskLoader.getHighResThumbnailLoader().setVisible(true);
}
public void onTrimMemory(int level) {
if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
// We already stop the loader in UI_HIDDEN, so stop the high res loader as well
// mRecentsTaskLoader.getHighResThumbnailLoader().setVisible(false);
mRecentsTaskLoader.getHighResThumbnailLoader().setVisible(false);
}
mRecentsTaskLoader.onTrimMemory(level);
}