reorder System shortcuts for taskbar and secondary display

Bug: 269343928
Bug: 272418357
Test: locally on device
Change-Id: Iec7f9ad702214c7ab7f49758dbf2463fe63b0324
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
index 0ed4538..cfc7813 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java
@@ -201,14 +201,12 @@
 
     // Create a Stream of all applicable system shortcuts
     private Stream<SystemShortcut.Factory> getSystemShortcuts() {
-        // concat a Stream of split options with a Stream of APP_INFO
-        Stream<SystemShortcut.Factory> appInfo = Stream.of(APP_INFO);
-
+        // append split options to APP_INFO shortcut, the order here will reflect in the popup
         return Stream.concat(
+                Stream.of(APP_INFO),
                 Utilities.getSplitPositionOptions(mContext.getDeviceProfile())
                         .stream()
-                        .map(this::createSplitShortcutFactory),
-                appInfo
+                        .map(this::createSplitShortcutFactory)
         );
     }
 
diff --git a/src/com/android/launcher3/secondarydisplay/SecondaryDragLayer.java b/src/com/android/launcher3/secondarydisplay/SecondaryDragLayer.java
index 2ffe34f..a917b68 100644
--- a/src/com/android/launcher3/secondarydisplay/SecondaryDragLayer.java
+++ b/src/com/android/launcher3/secondarydisplay/SecondaryDragLayer.java
@@ -197,13 +197,13 @@
             return false;
         }
 
+        // order of this list will reflect in the popup
         List<SystemShortcut> systemShortcuts = new ArrayList<>();
-
+        systemShortcuts.add(APP_INFO.getShortcut(mActivity, item, v));
         // Hide redundant pin shortcut for app drawer icons if drag-n-drop is enabled.
         if (!FeatureFlags.SECONDARY_DRAG_N_DROP_TO_PIN.get() || !mActivity.isAppDrawerShown()) {
             systemShortcuts.add(mPinnedAppsAdapter.getSystemShortcut(item, v));
         }
-        systemShortcuts.add(APP_INFO.getShortcut(mActivity, item, v));
         int deepShortcutCount = popupDataProvider.getShortcutCountForItem(item);
         final PopupContainerWithArrow<SecondaryDisplayLauncher> container;
         if (ENABLE_MATERIAL_U_POPUP.get()) {