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

Commit 493adec1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clean up enable_camera_compat_check_device_rotation_bugfix." into main

parents a75c28e0 9e5a007e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1747,8 +1747,7 @@ public final class CameraManager {
            // degrees (-90) for back camera, and 90 for front camera.
            // Use `displayRotation` param, sent by WindowManager, as the display rotation in the
            // app process might be sandboxed.
            if (displayRotation == ROTATION_90 && com.android.window.flags.Flags
                    .enableCameraCompatCheckDeviceRotationBugfix()) {
            if (displayRotation == ROTATION_90) {
                // The actual rotate and crop will be decided later, taking camera facing into
                // account: back camera: 270 degrees, front camera: 90 degrees.
                rotateAndCrop = Surface.ROTATION_270;
+1 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.server.wm;

import static android.app.WindowConfiguration.ROTATION_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.content.res.Configuration.UI_MODE_TYPE_MASK;
import static android.content.res.Configuration.UI_MODE_TYPE_VR_HEADSET;
@@ -234,9 +233,7 @@ final class AppCompatUtils {
            appCompatTaskInfo.cameraCompatTaskInfo.cameraCompatMode =
                    AppCompatCameraPolicy.getCameraCompatSimReqOrientationMode(top);
            appCompatTaskInfo.cameraCompatTaskInfo.displayRotation =
                    Flags.enableCameraCompatCheckDeviceRotationBugfix()
                            ? AppCompatCameraPolicy.getCameraDeviceRotation(top)
                            : ROTATION_UNDEFINED;
                    AppCompatCameraPolicy.getCameraDeviceRotation(top);
        }
        appCompatTaskInfo.setHasMinAspectRatioOverride(top.mAppCompatController
                .getDesktopAspectRatioPolicy().hasMinAspectRatioOverride(task));
+2 −3
Original line number Diff line number Diff line
@@ -226,10 +226,9 @@ public class AppCompatUtilsTest extends WindowTestsBase {
    }

    @Test
    @EnableFlags({Flags.FLAG_ENABLE_CAMERA_COMPAT_FOR_DESKTOP_WINDOWING,
            Flags.FLAG_ENABLE_CAMERA_COMPAT_CHECK_DEVICE_ROTATION_BUGFIX})
    @EnableFlags(Flags.FLAG_ENABLE_CAMERA_COMPAT_FOR_DESKTOP_WINDOWING)
    @DisableFlags(Flags.FLAG_ENABLE_CAMERA_COMPAT_COMPATIBILITY_INFO_ROTATE_AND_CROP_BUGFIX)
    public void testTopActivityInCameraCompatMode_rotationFlagEnabled_rotationSet() {
    public void testTopActivityInCameraCompatMode_rotationSet() {
        runTestScenario((robot) -> {
            robot.dw().allowEnterDesktopMode(/* isAllowed= */ true);
            robot.applyOnActivity(