Hide the split-screen request for secondary display task.

Currently, we cannot support the split-screen mode on the secondary
display. To prevent confused,disallowing split-screen request on
non-primary display tasks first.

Bug: 118266305
Test: 1. Use the ActivityViewTest to launch an application on virtual display.
      2. Check if the split-screen button exist on recent app.

Change-Id: Ifa6d70a1920aa4f33d260e37a3737e102949114e
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);
         }