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

Commit 8a00a2d6 authored by Robin Lee's avatar Robin Lee Committed by Android (Google) Code Review
Browse files

Merge "Continue to allow some orientation overrides" into main

parents 07616ebe 4b456799
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -8152,13 +8152,17 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     * into account orientation per-app overrides applied by the device manufacturers.
     */
    @Override
    @ActivityInfo.ScreenOrientation
    protected int getOverrideOrientation() {
        if (mWmService.mConstants.mIgnoreActivityOrientationRequest
                && info.applicationInfo.category != ApplicationInfo.CATEGORY_GAME) {
            return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
        final int candidateOrientation;
        if (!mWmService.mConstants.mIgnoreActivityOrientationRequest
                || info.applicationInfo.category == ApplicationInfo.CATEGORY_GAME) {
            candidateOrientation = super.getOverrideOrientation();
        } else {
            candidateOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
        }
        return mAppCompatController.getOrientationPolicy()
                .overrideOrientationIfNeeded(super.getOverrideOrientation());
                .overrideOrientationIfNeeded(candidateOrientation);
    }

    /**