Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16aaa462 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Do not ignore locked orientation by universal resizable" into main

parents 27a10f7d 10f8173b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -8180,7 +8180,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    @ActivityInfo.ScreenOrientation
    protected int getOverrideOrientation() {
        int candidateOrientation = super.getOverrideOrientation();
        if (ActivityInfo.isFixedOrientation(candidateOrientation) && isUniversalResizeable()) {
        if (candidateOrientation != ActivityInfo.SCREEN_ORIENTATION_LOCKED
                && ActivityInfo.isFixedOrientation(candidateOrientation)
                && isUniversalResizeable()) {
            candidateOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
        }
        return mAppCompatController.getOrientationPolicy()
+3 −3
Original line number Diff line number Diff line
@@ -2895,7 +2895,7 @@ public class SizeCompatTests extends WindowTestsBase {
        // Launch another portrait fixed app.
        spyOn(mTask);
        setBooted(display.mWmService.mAtmService);
        final ActivityRecord newActivity = new ActivityBuilder(display.mWmService.mAtmService)
        final ActivityRecord newActivity = getActivityBuilderWithoutTask()
                .setResizeMode(RESIZE_MODE_UNRESIZEABLE)
                .setScreenOrientation(SCREEN_ORIENTATION_PORTRAIT)
                .setTask(mTask)
@@ -2963,7 +2963,7 @@ public class SizeCompatTests extends WindowTestsBase {
        // Launch another portrait fixed app with max aspect ratio as 1.3.
        spyOn(mTask);
        setBooted(display.mWmService.mAtmService);
        final ActivityRecord newActivity = new ActivityBuilder(display.mWmService.mAtmService)
        final ActivityRecord newActivity = getActivityBuilderWithoutTask()
                .setResizeMode(RESIZE_MODE_UNRESIZEABLE)
                .setMaxAspectRatio(1.3f)
                .setScreenOrientation(SCREEN_ORIENTATION_PORTRAIT)
@@ -4788,7 +4788,7 @@ public class SizeCompatTests extends WindowTestsBase {
        final float maxAspect = 1.8f;
        final float minAspect = 1.5f;
        prepareLimitedBounds(mActivity, maxAspect, minAspect,
                ActivityInfo.SCREEN_ORIENTATION_LOCKED, true /* isUnresizable */);
                ActivityInfo.SCREEN_ORIENTATION_NOSENSOR, true /* isUnresizable */);

        assertTrue(mActivity.isUniversalResizeable());
        assertTrue(mActivity.isResizeable());