Pass in display when using DesktopMode APIs am: 0e068b1213

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22912129

Change-Id: I521903dc1b12271e38ad73264f9d3aa711f7e33e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ats Jenk
2023-04-28 00:00:04 +00:00
committed by Automerger Merge Worker
4 changed files with 10 additions and 9 deletions
@@ -52,9 +52,10 @@ public class RemoteTargetGluer {
*/
public RemoteTargetGluer(Context context, BaseActivityInterface sizingStrategy) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
// TODO: binder call, only for prototyping. Creating the gluer should be postponed so
// we can create it when we have the remote animation targets ready.
int desktopTasks = SystemUiProxy.INSTANCE.get(context).getVisibleDesktopTaskCount();
// TODO(279931899): binder call, only for prototyping. Creating the gluer should be
// postponed so we can create it when we have the remote animation targets ready.
int desktopTasks = SystemUiProxy.INSTANCE.get(context).getVisibleDesktopTaskCount(
context.getDisplayId());
if (desktopTasks > 0) {
init(context, sizingStrategy, desktopTasks, true /* forDesktop */);
return;
@@ -1060,10 +1060,10 @@ public class SystemUiProxy implements ISystemUiProxy {
//
/** Call shell to show all apps active on the desktop */
public void showDesktopApps() {
public void showDesktopApps(int displayId) {
if (mDesktopMode != null) {
try {
mDesktopMode.showDesktopApps();
mDesktopMode.showDesktopApps(displayId);
} catch (RemoteException e) {
Log.w(TAG, "Failed call showDesktopApps", e);
}
@@ -1071,10 +1071,10 @@ public class SystemUiProxy implements ISystemUiProxy {
}
/** Call shell to get number of visible freeform tasks */
public int getVisibleDesktopTaskCount() {
public int getVisibleDesktopTaskCount(int displayId) {
if (mDesktopMode != null) {
try {
return mDesktopMode.getVisibleTaskCount();
return mDesktopMode.getVisibleTaskCount(displayId);
} catch (RemoteException e) {
Log.w(TAG, "Failed call getVisibleDesktopTaskCount", e);
}
@@ -309,7 +309,7 @@ public class DesktopTaskView extends TaskView {
@Override
public RunnableList launchTasks() {
SystemUiProxy.INSTANCE.get(getContext()).showDesktopApps();
SystemUiProxy.INSTANCE.get(getContext()).showDesktopApps(mActivity.getDisplayId());
Launcher.getLauncher(mActivity).getStateManager().goToState(NORMAL, false /* animated */);
return null;
}
@@ -245,7 +245,7 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
desktopVisibilityController.setGestureInProgress(false);
}
if (showDesktopApps) {
SystemUiProxy.INSTANCE.get(mActivity).showDesktopApps();
SystemUiProxy.INSTANCE.get(mActivity).showDesktopApps(mActivity.getDisplayId());
}
}
}