Add running apps icons to taskbar for desktop environment.

This CL adds app icons for launched/running apps to the Launcher
taskbar hotseat. When the activity is closed, the app icon is
removed. The apps that are added to the taskbar on boot are never
removed.

Recall: http://recall/clips/ad6d3cfc-7358-4b37-846e-de843ad3000d

Bug: 183906774
Test: Launch an app and verify the app icon is added on the taskbar.
Close the app and verify the icon is removed from the taskbar.
Test: Switch navigation modes on the emulator and ensure that running
app icons are added to the taskbar after it is reinitialized.
Test: atest NexusLauncherTests:com.android.quickstep.RecentTasksListTest RecentTasksControllerTest

Change-Id: Ieaaf001530b5778871fb7a8d18cdcaa1ccbf0e31
This commit is contained in:
Merissa Tan
2022-01-25 19:46:55 -08:00
parent c480651522
commit 501ac7242d
10 changed files with 402 additions and 6 deletions
@@ -107,6 +107,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
public void onDestroy() {
LauncherAppState.getInstance(mActivity).getModel().removeCallbacks(mModelCallbacks);
mModelCallbacks.unregisterListeners();
}
public boolean areIconsVisible() {
@@ -298,6 +299,16 @@ 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();
}
/**
* Callbacks for {@link TaskbarView} to interact with its controller.
*/