Merge "Fix some issues with taskbar" into sc-dev

This commit is contained in:
TreeHugger Robot authored and Android (Google) Code Review committed 2021-02-09 01:34:32 +00:00
commit e263a44567
2 files changed
+8 -1

No files matched your search

@@ -57,6 +57,7 @@ public class TaskbarHotseatController {
protected void init() {
mLauncher.getDragController().addDragListener(mDragListener);
onHotseatUpdated();
}
protected void cleanup() {
@@ -50,6 +50,8 @@ public class TaskbarRecentsController {
// The current background requests to load the task icons
private CancellableTask[] mIconLoadRequests = new CancellableTask[mNumRecentIcons];
private boolean mIsAlive;
public TaskbarRecentsController(BaseQuickstepLauncher launcher,
TaskbarController.TaskbarRecentsControllerCallbacks taskbarCallbacks) {
mLauncher = launcher;
@@ -58,11 +60,13 @@ public class TaskbarRecentsController {
}
protected void init() {
mIsAlive = true;
TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackChangeListener);
reloadRecentTasksIfNeeded();
}
protected void cleanup() {
mIsAlive = false;
TaskStackChangeListeners.getInstance().unregisterTaskStackListener(
mTaskStackChangeListener);
cancelAllPendingIconLoadTasks();
@@ -84,7 +88,9 @@ public class TaskbarRecentsController {
}
private void onRecentTasksChanged(ArrayList<Task> tasks) {
mTaskbarCallbacks.updateRecentItems(tasks);
if (mIsAlive) {
mTaskbarCallbacks.updateRecentItems(tasks);
}
}
/**