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

Commit ee3ef2b8 authored by Ruben Brunk's avatar Ruben Brunk Committed by Android (Google) Code Review
Browse files

Merge changes Iccd4d53d,Id449bc7a into lmp-dev

* changes:
  camera2: Avoid setting null metering regions in LEGACY.
  camera2: Fix JPEG orientation set by LEGACY request.
parents 87038509 97b5301b
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());