Disallow userLeaving when split drag drop

We should avoid setting mUserLeaving=true when
bringing task to front that disallow entering PiP
due to the launching task coming to front.

Bug: 336477473
Test: repro the steps in the bug report
Change-Id: I94377538ab922b2ca03f295a847a8b8e4d1904df
(cherry picked from commit 86860b8e659b51dd48fffb3197a30d15b8482d3f)
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index f9c2c7e..30dedb2 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -1512,7 +1512,10 @@
         }
 
         try {
-            if ((flags & ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0) {
+            // We allow enter PiP for previous front task if not requested otherwise via options.
+            boolean shouldCauseEnterPip = options == null
+                    || !options.disallowEnterPictureInPictureWhileLaunching();
+            if ((flags & ActivityManager.MOVE_TASK_NO_USER_ACTION) == 0 && shouldCauseEnterPip) {
                 mUserLeaving = true;
             }