Skip testAutoPipOnLaunchingActivityWithNoUserAction in freeform

Usually, it is expected that an activity will not enter PIP if
it's removed from the foreground as a result of another activity
launch with the flag FLAG_ACTIVITY_NO_USER_ACTION. However,
there are cases in which PIP is requested immediately following
the activity launch for reasons that are 'user actions', it
should not be expected that the PIP activity cannot enter PIP
mode in such scenarios.

Bug: 226706258
Test: atest PinnedStackTests
Change-Id: I2074f487043955dfc7b1b39b0947aa588b11e384
(cherry picked from commit f4c48bc5cb046c9770edbdc666d0c8632d358ff3)
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java b/tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java
index dbfe7e9..b05be36 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/PinnedStackTests.java
@@ -1506,6 +1506,11 @@
         launchActivity(PIP_ACTIVITY, extraString(EXTRA_ALLOW_AUTO_PIP, "true"));
         assertPinnedStackDoesNotExist();
 
+        int windowingMode = mWmState.getTaskByActivity(PIP_ACTIVITY).getWindowingMode();
+        // Skip the test if freeform, since desktops may manually request PIP immediately after
+        // the test activity launch.
+        assumeFalse(windowingMode == WINDOWING_MODE_FREEFORM);
+
         // Launch a regular activity with FLAG_ACTIVITY_NO_USER_ACTION and
         // ensure that there is no pinned stack.
         launchActivityWithNoUserAction(TEST_ACTIVITY);