Don't let top activity to influence the orientation

An activity shouldn't influence the orientation of the device
just because it is currently on top, since it may be in the process
of being removed or covered by something else.

Bug: 76011287
Test: ActivityManagerAppConfigurationTests
Test: AppWindowTokenTests
Change-Id: Ie0660f9c935ab95100c107fa1331ef1c10898626
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index e637df4..0ba5a56 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -1297,7 +1297,7 @@
         // going to the bottom. Allowing closing {@link AppWindowToken} to participate can lead to
         // an Activity in another task being started in the wrong orientation during the transition.
         if (!(sendingToBottom || mService.mClosingApps.contains(this))
-                && (isVisible() || mService.mOpeningApps.contains(this) || isOnTop())) {
+                && (isVisible() || mService.mOpeningApps.contains(this))) {
             return mOrientation;
         }