Set up a place holder tile for desktop

Create a placeholder tile in recents for desktop.
It is based on launcher task information. With extra flag indicating it
is for desktop.
When it is clicked, it will call sysui to show apps on desktop.

Test: manually verify that desktop tasks do not show up separately in
recents
Bug: 244348395

Change-Id: I8535a54e1545841cd988d4770e6fc5e857277cda
This commit is contained in:
Ats Jenk committed 2022-09-23 16:28:48 -07:00
1 parent d859a20086
commit 919ddf19f3
4 files changed
+43 -4

No files matched your search

@@ -58,6 +58,7 @@ import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationCon
import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController;
import com.android.systemui.shared.system.smartspace.SmartspaceState;
import com.android.wm.shell.back.IBackAnimation;
import com.android.wm.shell.desktopmode.IDesktopMode;
import com.android.wm.shell.floating.IFloatingTasks;
import com.android.wm.shell.onehanded.IOneHanded;
import com.android.wm.shell.pip.IPip;
@@ -95,6 +96,7 @@ public class SystemUiProxy implements ISystemUiProxy {
private IStartingWindow mStartingWindow;
private IRecentTasks mRecentTasks;
private IBackAnimation mBackAnimation;
private IDesktopMode mDesktopMode;
private final DeathRecipient mSystemUiProxyDeathRecipient = () -> {
MAIN_EXECUTOR.execute(() -> clearProxy());
};
@@ -169,7 +171,7 @@ public class SystemUiProxy implements ISystemUiProxy {
IFloatingTasks floatingTasks, IOneHanded oneHanded, IShellTransitions shellTransitions,
IStartingWindow startingWindow, IRecentTasks recentTasks,
ISysuiUnlockAnimationController sysuiUnlockAnimationController,
IBackAnimation backAnimation) {
IBackAnimation backAnimation, IDesktopMode desktopMode) {
unlinkToDeath();
mSystemUiProxy = proxy;
mPip = pip;
@@ -181,6 +183,7 @@ public class SystemUiProxy implements ISystemUiProxy {
mSysuiUnlockAnimationController = sysuiUnlockAnimationController;
mRecentTasks = recentTasks;
mBackAnimation = backAnimation;
mDesktopMode = desktopMode;
linkToDeath();
// re-attach the listeners once missing due to setProxy has not been initialized yet.
if (mPipAnimationListener != null && mPip != null) {
@@ -207,7 +210,7 @@ public class SystemUiProxy implements ISystemUiProxy {
}
public void clearProxy() {
setProxy(null, null, null, null, null, null, null, null, null, null);
setProxy(null, null, null, null, null, null, null, null, null, null, null);
}
// TODO(141886704): Find a way to remove this
@@ -908,4 +911,19 @@ public class SystemUiProxy implements ISystemUiProxy {
return false;
}
//
// Desktop Mode
//
/** Call shell to show all apps active on the desktop */
public void showDesktopApps() {
if (mDesktopMode != null) {
try {
mDesktopMode.showDesktopApps();
} catch (RemoteException e) {
Log.w(TAG, "Failed call showDesktopApps", e);
}
}
}
}