Hide the split-screen request for secondary display task.
am: 860b9208c1

Change-Id: I6af6d1692449fbdafcb5a57694d994ab449e517e
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskSystemShortcut.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskSystemShortcut.java
index e3dcadc..e20ef52 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskSystemShortcut.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskSystemShortcut.java
@@ -16,6 +16,7 @@
 
 package com.android.quickstep;
 
+import static android.view.Display.DEFAULT_DISPLAY;
 import static com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch.TAP;
 
 import android.app.Activity;
@@ -116,21 +117,22 @@
             mHandler = new Handler(Looper.getMainLooper());
         }
 
-        protected abstract boolean isAvailable(BaseDraggingActivity activity);
+        protected abstract boolean isAvailable(BaseDraggingActivity activity, int displayId);
         protected abstract ActivityOptions makeLaunchOptions(Activity activity);
         protected abstract boolean onActivityStarted(BaseDraggingActivity activity);
 
         @Override
         public View.OnClickListener getOnClickListener(
                 BaseDraggingActivity activity, TaskView taskView) {
-            if (!isAvailable(activity)) {
-                return null;
-            }
             final Task task  = taskView.getTask();
             final int taskId = task.key.id;
+            final int displayId = task.key.displayId;
             if (!task.isDockable) {
                 return null;
             }
+            if (!isAvailable(activity, displayId)) {
+                return null;
+            }
             final RecentsView recentsView = activity.getOverviewPanel();
 
             final TaskThumbnailView thumbnailView = taskView.getThumbnail();
@@ -218,9 +220,13 @@
         }
 
         @Override
-        protected boolean isAvailable(BaseDraggingActivity activity) {
-            // Don't show menu-item if already in multi-window
-            return !activity.getDeviceProfile().isMultiWindowMode;
+        protected boolean isAvailable(BaseDraggingActivity activity, int displayId) {
+            // Don't show menu-item if already in multi-window and the task is from
+            // the secondary display.
+            // TODO(b/118266305): Temporarily disable splitscreen for secondary display while new
+            // implementation is enabled
+            return !activity.getDeviceProfile().isMultiWindowMode
+                    && displayId == DEFAULT_DISPLAY;
         }
 
         @Override
@@ -256,7 +262,7 @@
         }
 
         @Override
-        protected boolean isAvailable(BaseDraggingActivity activity) {
+        protected boolean isAvailable(BaseDraggingActivity activity, int displayId) {
             return ActivityManagerWrapper.getInstance().supportsFreeformMultiWindow(activity);
         }