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:
1 parent
ff83f1c448
commit
2021727f1e
7 files changed
+377
-292
No files matched your search
@@ -70,7 +70,8 @@ public class RecentTasksList {
|
||||
private TaskLoadResult mResultsBg = INVALID_RESULT;
|
||||
private TaskLoadResult mResultsUi = INVALID_RESULT;
|
||||
|
||||
private RecentsModel.RunningTasksListener mRunningTasksListener;
|
||||
private @Nullable RecentsModel.RunningTasksListener mRunningTasksListener;
|
||||
private @Nullable RecentsModel.RecentTasksChangedListener mRecentTasksChangedListener;
|
||||
// Tasks are stored in order of least recently launched to most recently launched.
|
||||
private ArrayList<ActivityManager.RunningTaskInfo> mRunningTasks;
|
||||
|
||||
@@ -199,6 +200,9 @@ public class RecentTasksList {
|
||||
|
||||
public void onRecentTasksChanged() {
|
||||
invalidateLoadedTasks();
|
||||
if (mRecentTasksChangedListener != null) {
|
||||
mRecentTasksChangedListener.onRecentTasksChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void invalidateLoadedTasks() {
|
||||
@@ -221,6 +225,21 @@ public class RecentTasksList {
|
||||
mRunningTasksListener = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a listener for running tasks
|
||||
*/
|
||||
public void registerRecentTasksChangedListener(
|
||||
RecentsModel.RecentTasksChangedListener listener) {
|
||||
mRecentTasksChangedListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the previously registered running tasks listener
|
||||
*/
|
||||
public void unregisterRecentTasksChangedListener() {
|
||||
mRecentTasksChangedListener = null;
|
||||
}
|
||||
|
||||
private void initRunningTasks(ArrayList<ActivityManager.RunningTaskInfo> runningTasks) {
|
||||
// Tasks are retrieved in order of most recently launched/used to least recently launched.
|
||||
mRunningTasks = new ArrayList<>(runningTasks);
|
||||
@@ -357,6 +376,7 @@ public class RecentTasksList {
|
||||
task.setLastSnapshotData(taskInfo);
|
||||
task.positionInParent = taskInfo.positionInParent;
|
||||
task.appBounds = taskInfo.configuration.windowConfiguration.getAppBounds();
|
||||
task.isVisible = taskInfo.isVisible;
|
||||
tasks.add(task);
|
||||
}
|
||||
return new DesktopTask(tasks);
|
||||
|
||||
Reference in new issue
Block a user