Loading services/core/java/com/android/server/wm/ActivityRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -7233,6 +7233,12 @@ final class ActivityRecord extends WindowToken { return belowCandidate.getRequestedConfigurationOrientation(forDisplay); } } // Although isRestrictedFixedOrientation excludes "locked" orientation, the configuration // orientation should not be restricted to portrait or landscape. if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED && isUniversalResizeable()) { return ORIENTATION_UNDEFINED; } return super.getRequestedConfigurationOrientation(forDisplay, requestedOrientation); } Loading services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +13 −0 Original line number Diff line number Diff line Loading @@ -5443,6 +5443,19 @@ public class SizeCompatTests extends WindowTestsBase { makeDisplayLargeScreen(mDisplayContent); assertTrue(mActivity.isUniversalResizeable()); assertFitted(); // Though "locked" orientation is respected to keep current display orientation, it should // not be treated as fixed in portrait or landscape. setUpApp(mDisplayContent, new ActivityBuilder(mAtm) .setResizeMode(RESIZE_MODE_UNRESIZEABLE) .setScreenOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED)); assertEquals(ActivityInfo.SCREEN_ORIENTATION_LOCKED, mActivity.getOverrideOrientation()); assertEquals("Must not be a specific orientation", Configuration.ORIENTATION_UNDEFINED, mActivity.getRequestedConfigurationOrientation()); final Rect resizeBounds = new Rect(mActivity.getTask().getBounds()); resizeBounds.scale(0.8f); mActivity.getTask().setBounds(resizeBounds); assertFitted(); } @Test Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -7233,6 +7233,12 @@ final class ActivityRecord extends WindowToken { return belowCandidate.getRequestedConfigurationOrientation(forDisplay); } } // Although isRestrictedFixedOrientation excludes "locked" orientation, the configuration // orientation should not be restricted to portrait or landscape. if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED && isUniversalResizeable()) { return ORIENTATION_UNDEFINED; } return super.getRequestedConfigurationOrientation(forDisplay, requestedOrientation); } Loading
services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +13 −0 Original line number Diff line number Diff line Loading @@ -5443,6 +5443,19 @@ public class SizeCompatTests extends WindowTestsBase { makeDisplayLargeScreen(mDisplayContent); assertTrue(mActivity.isUniversalResizeable()); assertFitted(); // Though "locked" orientation is respected to keep current display orientation, it should // not be treated as fixed in portrait or landscape. setUpApp(mDisplayContent, new ActivityBuilder(mAtm) .setResizeMode(RESIZE_MODE_UNRESIZEABLE) .setScreenOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED)); assertEquals(ActivityInfo.SCREEN_ORIENTATION_LOCKED, mActivity.getOverrideOrientation()); assertEquals("Must not be a specific orientation", Configuration.ORIENTATION_UNDEFINED, mActivity.getRequestedConfigurationOrientation()); final Rect resizeBounds = new Rect(mActivity.getTask().getBounds()); resizeBounds.scale(0.8f); mActivity.getTask().setBounds(resizeBounds); assertFitted(); } @Test Loading