Loading services/core/java/com/android/server/wm/AppCompatOrientationPolicy.java +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCA import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER; import static android.content.pm.ActivityInfo.isFixedOrientation; import static android.content.pm.ActivityInfo.isFixedOrientationLandscape; import static android.content.pm.ActivityInfo.isFixedOrientationPortrait; import static android.content.pm.ActivityInfo.screenOrientationToString; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM; Loading Loading @@ -66,6 +67,7 @@ class AppCompatOrientationPolicy { final boolean shouldCameraCompatControlOrientation = AppCompatCameraPolicy.shouldCameraCompatControlOrientation(mActivityRecord); if (hasFullscreenOverride && isIgnoreOrientationRequestEnabled && (isFixedOrientationLandscape(candidate) || isFixedOrientationPortrait(candidate)) // Do not override orientation to fullscreen for camera activities. // Fixed-orientation activities are rarely tested in other orientations, and it // often results in sideways or stretched previews. As the camera compat treatment Loading services/core/java/com/android/server/wm/AppCompatSizeCompatModePolicy.java +2 −2 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class AppCompatSizeCompatModePolicy { /** * The precomputed display insets for resolving configuration. It will be non-null if * {@link #shouldCreateAppCompatDisplayInsets} returns {@code true}. * {@link ActivityRecord#shouldCreateAppCompatDisplayInsets} returns {@code true}. */ @Nullable private AppCompatDisplayInsets mAppCompatDisplayInsets; Loading @@ -84,7 +84,7 @@ class AppCompatSizeCompatModePolicy { } /** * @return The {@code true} if the current instance has {@link mAppCompatDisplayInsets} without * @return The {@code true} if the current instance has {@link #mAppCompatDisplayInsets} without * considering the inheritance implemented in {@link #getAppCompatDisplayInsets()} */ boolean hasAppCompatDisplayInsetsWithoutInheritance() { Loading services/tests/wmtests/src/com/android/server/wm/AppCompatOrientationPolicyTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -302,15 +302,15 @@ public class AppCompatOrientationPolicyTest extends WindowTestsBase { } @Test public void testOverrideOrientationIfNeeded_userFullscreenOverride_returnsUser() { public void testOverrideOrientationIfNeeded_userFullscreenOverride_notLetterboxed_unchanged() { runTestScenarioWithActivity((robot) -> { robot.applyOnActivity((a) -> { a.setShouldApplyUserFullscreenOverride(true); a.setIgnoreOrientationRequest(true); }); robot.checkOverrideOrientation(/* candidate */ SCREEN_ORIENTATION_UNSPECIFIED, /* expected */ SCREEN_ORIENTATION_USER); robot.checkOverrideOrientation(/* candidate */ SCREEN_ORIENTATION_LOCKED, /* expected */ SCREEN_ORIENTATION_LOCKED); }); } Loading Loading
services/core/java/com/android/server/wm/AppCompatOrientationPolicy.java +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCA import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER; import static android.content.pm.ActivityInfo.isFixedOrientation; import static android.content.pm.ActivityInfo.isFixedOrientationLandscape; import static android.content.pm.ActivityInfo.isFixedOrientationPortrait; import static android.content.pm.ActivityInfo.screenOrientationToString; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM; Loading Loading @@ -66,6 +67,7 @@ class AppCompatOrientationPolicy { final boolean shouldCameraCompatControlOrientation = AppCompatCameraPolicy.shouldCameraCompatControlOrientation(mActivityRecord); if (hasFullscreenOverride && isIgnoreOrientationRequestEnabled && (isFixedOrientationLandscape(candidate) || isFixedOrientationPortrait(candidate)) // Do not override orientation to fullscreen for camera activities. // Fixed-orientation activities are rarely tested in other orientations, and it // often results in sideways or stretched previews. As the camera compat treatment Loading
services/core/java/com/android/server/wm/AppCompatSizeCompatModePolicy.java +2 −2 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class AppCompatSizeCompatModePolicy { /** * The precomputed display insets for resolving configuration. It will be non-null if * {@link #shouldCreateAppCompatDisplayInsets} returns {@code true}. * {@link ActivityRecord#shouldCreateAppCompatDisplayInsets} returns {@code true}. */ @Nullable private AppCompatDisplayInsets mAppCompatDisplayInsets; Loading @@ -84,7 +84,7 @@ class AppCompatSizeCompatModePolicy { } /** * @return The {@code true} if the current instance has {@link mAppCompatDisplayInsets} without * @return The {@code true} if the current instance has {@link #mAppCompatDisplayInsets} without * considering the inheritance implemented in {@link #getAppCompatDisplayInsets()} */ boolean hasAppCompatDisplayInsetsWithoutInheritance() { Loading
services/tests/wmtests/src/com/android/server/wm/AppCompatOrientationPolicyTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -302,15 +302,15 @@ public class AppCompatOrientationPolicyTest extends WindowTestsBase { } @Test public void testOverrideOrientationIfNeeded_userFullscreenOverride_returnsUser() { public void testOverrideOrientationIfNeeded_userFullscreenOverride_notLetterboxed_unchanged() { runTestScenarioWithActivity((robot) -> { robot.applyOnActivity((a) -> { a.setShouldApplyUserFullscreenOverride(true); a.setIgnoreOrientationRequest(true); }); robot.checkOverrideOrientation(/* candidate */ SCREEN_ORIENTATION_UNSPECIFIED, /* expected */ SCREEN_ORIENTATION_USER); robot.checkOverrideOrientation(/* candidate */ SCREEN_ORIENTATION_LOCKED, /* expected */ SCREEN_ORIENTATION_LOCKED); }); } Loading