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

Commit 925abedb authored by Austin Borger's avatar Austin Borger
Browse files

CameraService: Disable overrideToPortrait for dumpsys media.camera.

Also upgrade logging for the sensor orientation override to info,
and add a log for when the device orientation map is erased. This
is required for debugging purposes.

Bug: 264647891
Test: Ran adb shell dumpsys media.camera.
Change-Id: Iccd937f61173be310b85e36e88be1b3ce984e4a0
parent abe5ea1b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2029,7 +2029,7 @@ status_t CameraProviderManager::ProviderInfo::dump(int fd, const Vector<String16
        }
        CameraMetadata info2;
        res = device->getCameraCharacteristics(true /*overrideForPerfClass*/, &info2,
                /*overrideToPortrait*/true);
                /*overrideToPortrait*/false);
        if (res == INVALID_OPERATION) {
            dprintf(fd, "  API2 not directly supported\n");
        } else if (res != OK) {
@@ -2380,8 +2380,8 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo3::getCameraCharacterist
    if (overrideToPortrait) {
        const auto &lensFacingEntry = characteristics->find(ANDROID_LENS_FACING);
        const auto &sensorOrientationEntry = characteristics->find(ANDROID_SENSOR_ORIENTATION);
        if (lensFacingEntry.count > 0 && sensorOrientationEntry.count > 0) {
        uint8_t lensFacing = lensFacingEntry.data.u8[0];
        if (lensFacingEntry.count > 0 && sensorOrientationEntry.count > 0) {
            int32_t sensorOrientation = sensorOrientationEntry.data.i32[0];
            int32_t newSensorOrientation = sensorOrientation;

@@ -2402,6 +2402,8 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo3::getCameraCharacterist
        }

        if (characteristics->exists(ANDROID_INFO_DEVICE_STATE_ORIENTATIONS)) {
            ALOGV("%s: Erasing ANDROID_INFO_DEVICE_STATE_ORIENTATIONS for lens facing %d",
                    __FUNCTION__, lensFacing);
            characteristics->erase(ANDROID_INFO_DEVICE_STATE_ORIENTATIONS);
        }
    }