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

Commit 8aa88195 authored by Ruben Brunk's avatar Ruben Brunk Committed by Android Git Automerger
Browse files

am 3b57d98a: Merge changes Iccd4d53d,Id449bc7a into lmp-dev

* commit '3b57d98a1a84ce063cb3681cae10795216300035':
  camera2: Avoid setting null metering regions in LEGACY.
  camera2: Fix JPEG orientation set by LEGACY request.
parents 76e94541 ee3ef2b8
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -399,8 +399,9 @@ public class LegacyRequestMapper {

        // jpeg.orientation
        {
            int orientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
            params.setRotation(ParamsUtils.getOrDefault(request, JPEG_ORIENTATION, orientation));
            Integer orientation = request.get(CaptureRequest.JPEG_ORIENTATION);
            params.setRotation(ParamsUtils.getOrDefault(request, JPEG_ORIENTATION,
                    (orientation == null) ? 0 : orientation));
        }

        // jpeg.quality
@@ -496,6 +497,11 @@ public class LegacyRequestMapper {
            }
        }

        if (meteringRectangleList.size() == 0) {
            Log.w(TAG, "Only received metering rectangles with weight 0.");
            return Arrays.asList(ParameterUtils.CAMERA_AREA_DEFAULT);
        }

        // Ignore any regions beyond our maximum supported count
        int countMeteringAreas =
                Math.min(maxNumMeteringAreas, meteringRectangleList.size());