From a31d58f7c11706fc5e4e27fd30ad0e57627dfc26 Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Thu, 8 Feb 2018 12:44:47 -0800 Subject: [PATCH] Camera: Clarify AF_REGIONS behavior in capture_result If application specifies 0-weight AF_REGIONS in capture request, the camera device is allowed to override with non-0-weight AF_REGIONS in capture result. Test: Build Bug: 29398609 Change-Id: I771ba45a1ae0fd26fcacc9891aa4444f718f0f3c --- core/java/android/hardware/camera2/CaptureRequest.java | 3 ++- core/java/android/hardware/camera2/CaptureResult.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index 3ed533a4efcbd..3c16e28f213db 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -1432,7 +1432,8 @@ public final class CaptureRequest extends CameraMetadata> * is used, all non-zero weights will have the same effect. A region with 0 weight is * ignored.

*

If all regions have 0 weight, then no specific metering area needs to be used by the - * camera device.

+ * camera device. The capture result will either be a zero weight region as well, or + * the region selected by the camera device as the focus area of interest.

*

If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in * capture result metadata, the camera device will ignore the sections outside the crop * region and output only the intersection rectangle as the metering region in the result diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index c332d3028aed0..cac89cf805d9b 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -1156,7 +1156,8 @@ public class CaptureResult extends CameraMetadata> { * is used, all non-zero weights will have the same effect. A region with 0 weight is * ignored.

*

If all regions have 0 weight, then no specific metering area needs to be used by the - * camera device.

+ * camera device. The capture result will either be a zero weight region as well, or + * the region selected by the camera device as the focus area of interest.

*

If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in * capture result metadata, the camera device will ignore the sections outside the crop * region and output only the intersection rectangle as the metering region in the result