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

Commit 97b5301b authored by Ruben Brunk's avatar Ruben Brunk
Browse files

camera2: Avoid setting null metering regions in LEGACY.

Bug: 17587491

- If a single region with zero weight is set, revert to default
  metering region rather than attempting to set a null to
  avoid setParameters failure.

Change-Id: Iccd4d53d5a2134a9d744eafb731f464b653a154d
parent 09a6bed6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -497,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());