Change running apps section to use GroupTask instead of AppInfo

- No longer bind All Apps to TaskbarRecentsController, and register
  RecentsModel.RecentTasksChangedListener instead
- The source of truth for "running tasks" in Desktop mode is the
  DesktopTask#tasks list itself, instead of
  RecentsModel.RunningTasksListener (which is no longer used)
- Added TaskInfo.TaskKey#isVisible to distinguish minimized running apps
- Next CL will hook up the UI for Recent/Running tasks that are
  not part of the Hotseat.

Flag: com.android.launcher3.enable_recents_in_taskbar
Test: TaskbarRecentAppsControllerTest
Fixes: 335398876
Bug: 315354060
Change-Id: I1313f97a791c5c0c1db7443a5d4f1d5bc761981f
This commit is contained in:
Tony Wickham
2024-05-22 21:12:09 +00:00
parent ff83f1c448
commit 2021727f1e
7 changed files with 377 additions and 292 deletions
@@ -224,7 +224,6 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
LauncherAppState.getInstance(mActivity).getModel().removeCallbacks(mModelCallbacks);
mActivity.removeOnDeviceProfileChangeListener(mDeviceProfileChangeListener);
mModelCallbacks.unregisterListeners();
}
public boolean areIconsVisible() {
@@ -869,6 +868,11 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
return mTaskbarView.isEventOverAnyItem(ev);
}
/** Called when there's a change in running apps to update the UI. */
public void commitRunningAppsToUI() {
mModelCallbacks.commitRunningAppsToUI();
}
@Override
public void dumpLogs(String prefix, PrintWriter pw) {
pw.println(prefix + "TaskbarViewController:");
@@ -889,14 +893,4 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
mModelCallbacks.dumpLogs(prefix + "\t", pw);
}
/** Called when there's a change in running apps to update the UI. */
public void commitRunningAppsToUI() {
mModelCallbacks.commitRunningAppsToUI();
}
/** Call TaskbarModelCallbacks to update running apps. */
public void updateRunningApps() {
mModelCallbacks.updateRunningApps();
}
}