Loading services/core/java/com/android/server/wm/DisplayContent.java +6 −9 Original line number Diff line number Diff line Loading @@ -6362,10 +6362,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } /** * Returns the fixed orientation requested by a transient launch (e.g. recents animation). * If it doesn't return SCREEN_ORIENTATION_UNSET, the rotation change should be deferred. * Returns {@code true} if the transient launch (e.g. recents animation) requested a fixed * orientation, then the rotation change should be deferred. */ @ActivityInfo.ScreenOrientation int getTransientFixedOrientation() { boolean shouldDeferRotation() { ActivityRecord source = null; if (mTransitionController.isShellTransitionsEnabled()) { final ActivityRecord r = mFixedRotationLaunchingApp; Loading @@ -6377,13 +6377,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } if (source == null || source.getRequestedConfigurationOrientation( true /* forDisplay */) == ORIENTATION_UNDEFINED) { return SCREEN_ORIENTATION_UNSET; return false; } if (!mWmService.mPolicy.okToAnimate(false /* ignoreScreenOn */)) { // If screen is off or the device is going to sleep, then still allow to update. return SCREEN_ORIENTATION_UNSET; } return source.mOrientation; return mWmService.mPolicy.okToAnimate(false /* ignoreScreenOn */); } @Override Loading services/core/java/com/android/server/wm/DisplayRotation.java +2 −4 Original line number Diff line number Diff line Loading @@ -446,12 +446,10 @@ public class DisplayRotation { return false; } final int transientFixedOrientation = mDisplayContent.mFixedRotationTransitionListener.getTransientFixedOrientation(); if (transientFixedOrientation != SCREEN_ORIENTATION_UNSET) { if (mDisplayContent.mFixedRotationTransitionListener.shouldDeferRotation()) { // Makes sure that after the transition is finished, updateOrientation() can see // the difference from the latest orientation source. mLastOrientation = transientFixedOrientation; mLastOrientation = SCREEN_ORIENTATION_UNSET; // During the recents animation, the closing app might still be considered on top. // In order to ignore its requested orientation to avoid a sensor led rotation (e.g // user rotating the device while the recents animation is running), we ignore Loading services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -451,7 +451,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { final DisplayRotation displayRotation = mDisplayContent.getDisplayRotation(); final int topOrientation = DisplayContentTests.getRotatedOrientation(mDefaultDisplay); assertFalse(displayRotation.updateOrientation(topOrientation, false /* forceUpdate */)); assertEquals(recents.mOrientation, displayRotation.getLastOrientation()); assertEquals(ActivityInfo.SCREEN_ORIENTATION_UNSET, displayRotation.getLastOrientation()); final int prevRotation = mDisplayContent.getRotation(); mWm.cleanupRecentsAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION); Loading services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET; import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; Loading Loading @@ -691,7 +692,7 @@ public class TransitionTests extends WindowTestsBase { anyInt() /* orientation */, anyInt() /* lastRotation */); // Rotation update is skipped while the recents animation is running. assertFalse(mDisplayContent.updateRotationUnchecked()); assertEquals(SCREEN_ORIENTATION_NOSENSOR, displayRotation.getLastOrientation()); assertEquals(SCREEN_ORIENTATION_UNSET, displayRotation.getLastOrientation()); // Return to the app without fixed orientation from recents. app.moveFocusableActivityToTop("test"); player.finish(); Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +6 −9 Original line number Diff line number Diff line Loading @@ -6362,10 +6362,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } /** * Returns the fixed orientation requested by a transient launch (e.g. recents animation). * If it doesn't return SCREEN_ORIENTATION_UNSET, the rotation change should be deferred. * Returns {@code true} if the transient launch (e.g. recents animation) requested a fixed * orientation, then the rotation change should be deferred. */ @ActivityInfo.ScreenOrientation int getTransientFixedOrientation() { boolean shouldDeferRotation() { ActivityRecord source = null; if (mTransitionController.isShellTransitionsEnabled()) { final ActivityRecord r = mFixedRotationLaunchingApp; Loading @@ -6377,13 +6377,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } if (source == null || source.getRequestedConfigurationOrientation( true /* forDisplay */) == ORIENTATION_UNDEFINED) { return SCREEN_ORIENTATION_UNSET; return false; } if (!mWmService.mPolicy.okToAnimate(false /* ignoreScreenOn */)) { // If screen is off or the device is going to sleep, then still allow to update. return SCREEN_ORIENTATION_UNSET; } return source.mOrientation; return mWmService.mPolicy.okToAnimate(false /* ignoreScreenOn */); } @Override Loading
services/core/java/com/android/server/wm/DisplayRotation.java +2 −4 Original line number Diff line number Diff line Loading @@ -446,12 +446,10 @@ public class DisplayRotation { return false; } final int transientFixedOrientation = mDisplayContent.mFixedRotationTransitionListener.getTransientFixedOrientation(); if (transientFixedOrientation != SCREEN_ORIENTATION_UNSET) { if (mDisplayContent.mFixedRotationTransitionListener.shouldDeferRotation()) { // Makes sure that after the transition is finished, updateOrientation() can see // the difference from the latest orientation source. mLastOrientation = transientFixedOrientation; mLastOrientation = SCREEN_ORIENTATION_UNSET; // During the recents animation, the closing app might still be considered on top. // In order to ignore its requested orientation to avoid a sensor led rotation (e.g // user rotating the device while the recents animation is running), we ignore Loading
services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -451,7 +451,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { final DisplayRotation displayRotation = mDisplayContent.getDisplayRotation(); final int topOrientation = DisplayContentTests.getRotatedOrientation(mDefaultDisplay); assertFalse(displayRotation.updateOrientation(topOrientation, false /* forceUpdate */)); assertEquals(recents.mOrientation, displayRotation.getLastOrientation()); assertEquals(ActivityInfo.SCREEN_ORIENTATION_UNSET, displayRotation.getLastOrientation()); final int prevRotation = mDisplayContent.getRotation(); mWm.cleanupRecentsAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION); Loading
services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET; import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; Loading Loading @@ -691,7 +692,7 @@ public class TransitionTests extends WindowTestsBase { anyInt() /* orientation */, anyInt() /* lastRotation */); // Rotation update is skipped while the recents animation is running. assertFalse(mDisplayContent.updateRotationUnchecked()); assertEquals(SCREEN_ORIENTATION_NOSENSOR, displayRotation.getLastOrientation()); assertEquals(SCREEN_ORIENTATION_UNSET, displayRotation.getLastOrientation()); // Return to the app without fixed orientation from recents. app.moveFocusableActivityToTop("test"); player.finish(); Loading