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

Commit 99c86797 authored by Graciela Putri's avatar Graciela Putri Committed by Automerger Merge Worker
Browse files

Merge "Override SCREEN_ORIENTATION_LOCKED to portrait" into udc-qpr-dev am:...

Merge "Override SCREEN_ORIENTATION_LOCKED to portrait" into udc-qpr-dev am: ac6c983f am: 7f8b72d1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24813236



Change-Id: Ifc1c84c5e7e64b4097680bd045310c8fe4ad6408
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a79bd02a 7f8b72d1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import static android.content.pm.ActivityInfo.OVERRIDE_RESPECT_REQUESTED_ORIENTA
import static android.content.pm.ActivityInfo.OVERRIDE_UNDEFINED_ORIENTATION_TO_NOSENSOR;
import static android.content.pm.ActivityInfo.OVERRIDE_UNDEFINED_ORIENTATION_TO_PORTRAIT;
import static android.content.pm.ActivityInfo.OVERRIDE_USE_DISPLAY_LANDSCAPE_NATURAL_ORIENTATION;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LOCKED;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
@@ -672,7 +673,8 @@ final class LetterboxUiController {
        // orientation.
        candidate = mActivityRecord.mWmService.mapOrientationRequest(candidate);

        if (shouldApplyUserMinAspectRatioOverride() && !isFixedOrientation(candidate)) {
        if (shouldApplyUserMinAspectRatioOverride() && (!isFixedOrientation(candidate)
                || candidate == SCREEN_ORIENTATION_LOCKED)) {
            Slog.v(TAG, "Requested orientation " + screenOrientationToString(candidate) + " for "
                    + mActivityRecord + " is overridden to "
                    + screenOrientationToString(SCREEN_ORIENTATION_PORTRAIT)
+4 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import static android.content.pm.ActivityInfo.OVERRIDE_UNDEFINED_ORIENTATION_TO_
import static android.content.pm.ActivityInfo.OVERRIDE_UNDEFINED_ORIENTATION_TO_PORTRAIT;
import static android.content.pm.ActivityInfo.OVERRIDE_USE_DISPLAY_LANDSCAPE_NATURAL_ORIENTATION;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LOCKED;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
@@ -819,6 +820,9 @@ public class LetterboxUiControllerTest extends WindowTestsBase {
        assertEquals(mController.overrideOrientationIfNeeded(
                /* candidate */ SCREEN_ORIENTATION_UNSPECIFIED), SCREEN_ORIENTATION_PORTRAIT);

        assertEquals(mController.overrideOrientationIfNeeded(
                /* candidate */ SCREEN_ORIENTATION_LOCKED), SCREEN_ORIENTATION_PORTRAIT);

        // unchanged if orientation is specified
        assertEquals(mController.overrideOrientationIfNeeded(
                /* candidate */ SCREEN_ORIENTATION_LANDSCAPE), SCREEN_ORIENTATION_LANDSCAPE);