Merge "Camera: HAL3.3 LSC keys CTS update" into mnc-dev
diff --git a/tests/tests/hardware/src/android/hardware/camera2/cts/CaptureRequestTest.java b/tests/tests/hardware/src/android/hardware/camera2/cts/CaptureRequestTest.java
index f3acf4c..42da12e 100644
--- a/tests/tests/hardware/src/android/hardware/camera2/cts/CaptureRequestTest.java
+++ b/tests/tests/hardware/src/android/hardware/camera2/cts/CaptureRequestTest.java
@@ -188,45 +188,61 @@
openDevice(mCameraIds[i]);
if (!mStaticInfo.isManualLensShadingMapSupported()) {
+ Log.i(TAG, "Camera " + mCameraIds[i] +
+ " doesn't support lens shading controls, skipping test");
+ continue;
+ }
+
+ List<Integer> lensShadingMapModes = Arrays.asList(CameraTestUtils.toObject(
+ mStaticInfo.getAvailableLensShadingMapModesChecked()));
+
+ if (!lensShadingMapModes.contains(STATISTICS_LENS_SHADING_MAP_MODE_ON)) {
continue;
}
SimpleCaptureCallback listener = new SimpleCaptureCallback();
CaptureRequest.Builder requestBuilder =
mCamera.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
-
- // Shading map mode OFF, lensShadingMapMode ON, camera device
- // should output unity maps.
- requestBuilder.set(CaptureRequest.SHADING_MODE, SHADING_MODE_OFF);
requestBuilder.set(CaptureRequest.STATISTICS_LENS_SHADING_MAP_MODE,
STATISTICS_LENS_SHADING_MAP_MODE_ON);
Size previewSz =
getMaxPreviewSize(mCamera.getId(), mCameraManager, PREVIEW_SIZE_BOUND);
+ List<Integer> lensShadingModes = Arrays.asList(CameraTestUtils.toObject(
+ mStaticInfo.getAvailableLensShadingModesChecked()));
- listener = new SimpleCaptureCallback();
- startPreview(requestBuilder, previewSz, listener);
- waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_UNKNOWN_LATENCY);
- verifyShadingMap(listener, NUM_FRAMES_VERIFIED, SHADING_MODE_OFF);
+ // Shading map mode OFF, lensShadingMapMode ON, camera device
+ // should output unity maps.
+ if (lensShadingModes.contains(SHADING_MODE_OFF)) {
+ requestBuilder.set(CaptureRequest.SHADING_MODE, SHADING_MODE_OFF);
+ listener = new SimpleCaptureCallback();
+ startPreview(requestBuilder, previewSz, listener);
+ waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_UNKNOWN_LATENCY);
+ verifyShadingMap(listener, NUM_FRAMES_VERIFIED, SHADING_MODE_OFF);
+ }
// Shading map mode FAST, lensShadingMapMode ON, camera device
// should output valid maps.
- requestBuilder.set(CaptureRequest.SHADING_MODE, SHADING_MODE_FAST);
+ if (lensShadingModes.contains(SHADING_MODE_FAST)) {
+ requestBuilder.set(CaptureRequest.SHADING_MODE, SHADING_MODE_FAST);
- listener = new SimpleCaptureCallback();
- startPreview(requestBuilder, previewSz, listener);
- waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_UNKNOWN_LATENCY);
- // Allow at most one lock OFF state as the exposure is changed once.
- verifyShadingMap(listener, NUM_FRAMES_VERIFIED, SHADING_MODE_FAST);
+ listener = new SimpleCaptureCallback();
+ startPreview(requestBuilder, previewSz, listener);
+ waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_UNKNOWN_LATENCY);
+ // Allow at most one lock OFF state as the exposure is changed once.
+ verifyShadingMap(listener, NUM_FRAMES_VERIFIED, SHADING_MODE_FAST);
+ }
// Shading map mode HIGH_QUALITY, lensShadingMapMode ON, camera device
// should output valid maps.
- requestBuilder.set(CaptureRequest.SHADING_MODE, SHADING_MODE_HIGH_QUALITY);
+ if (lensShadingModes.contains(SHADING_MODE_HIGH_QUALITY)) {
+ requestBuilder.set(CaptureRequest.SHADING_MODE, SHADING_MODE_HIGH_QUALITY);
- listener = new SimpleCaptureCallback();
- startPreview(requestBuilder, previewSz, listener);
- waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_UNKNOWN_LATENCY);
- verifyShadingMap(listener, NUM_FRAMES_VERIFIED, SHADING_MODE_HIGH_QUALITY);
+ listener = new SimpleCaptureCallback();
+ startPreview(requestBuilder, previewSz, listener);
+ waitForSettingsApplied(listener, NUM_FRAMES_WAITED_FOR_UNKNOWN_LATENCY);
+ verifyShadingMap(listener, NUM_FRAMES_VERIFIED, SHADING_MODE_HIGH_QUALITY);
+ }
stopPreview();
} finally {
diff --git a/tests/tests/hardware/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java b/tests/tests/hardware/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java
index 38332a1..04375cb 100644
--- a/tests/tests/hardware/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java
+++ b/tests/tests/hardware/src/android/hardware/camera2/cts/ExtendedCameraCharacteristicsTest.java
@@ -259,8 +259,10 @@
expectKeyAvailable(c, CameraCharacteristics.SENSOR_ORIENTATION , LEGACY , BC );
expectKeyAvailable(c, CameraCharacteristics.SENSOR_REFERENCE_ILLUMINANT1 , OPT , RAW );
expectKeyAvailable(c, CameraCharacteristics.SENSOR_REFERENCE_ILLUMINANT2 , OPT , RAW );
+ expectKeyAvailable(c, CameraCharacteristics.SHADING_AVAILABLE_MODES , LIMITED , MANUAL_POSTPROC, RAW );
expectKeyAvailable(c, CameraCharacteristics.STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES , LEGACY , BC );
expectKeyAvailable(c, CameraCharacteristics.STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES , OPT , RAW );
+ expectKeyAvailable(c, CameraCharacteristics.STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES, LIMITED , RAW );
expectKeyAvailable(c, CameraCharacteristics.STATISTICS_INFO_MAX_FACE_COUNT , LEGACY , BC );
expectKeyAvailable(c, CameraCharacteristics.SYNC_MAX_LATENCY , LEGACY , BC );
expectKeyAvailable(c, CameraCharacteristics.TONEMAP_AVAILABLE_TONE_MAP_MODES , FULL , MANUAL_POSTPROC );
diff --git a/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/StaticMetadata.java b/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/StaticMetadata.java
index b63541b..36fedae 100644
--- a/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/StaticMetadata.java
+++ b/tests/tests/hardware/src/android/hardware/camera2/cts/helpers/StaticMetadata.java
@@ -1655,6 +1655,52 @@
}
/**
+ * Get available lens shading modes.
+ */
+ public int[] getAvailableLensShadingModesChecked() {
+ Key<int[]> key =
+ CameraCharacteristics.SHADING_AVAILABLE_MODES;
+ int[] modes = getValueFromKeyNonNull(key);
+ if (modes == null) {
+ return new int[0];
+ }
+
+ List<Integer> modeList = Arrays.asList(CameraTestUtils.toObject(modes));
+ // FAST must be included.
+ checkTrueForKey(key, " FAST must be included",
+ modeList.contains(CameraMetadata.SHADING_MODE_FAST));
+
+ if (isCapabilitySupported(
+ CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING)) {
+ checkTrueForKey(key, " OFF must be included for MANUAL_POST_PROCESSING devices",
+ modeList.contains(CameraMetadata.SHADING_MODE_OFF));
+ }
+ return modes;
+ }
+
+ /**
+ * Get available lens shading map modes.
+ */
+ public int[] getAvailableLensShadingMapModesChecked() {
+ Key<int[]> key =
+ CameraCharacteristics.STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES;
+ int[] modes = getValueFromKeyNonNull(key);
+ if (modes == null) {
+ return new int[0];
+ }
+
+ List<Integer> modeList = Arrays.asList(CameraTestUtils.toObject(modes));
+
+ if (isCapabilitySupported(
+ CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_RAW)) {
+ checkTrueForKey(key, " ON must be included for RAW capability devices",
+ modeList.contains(CameraMetadata.STATISTICS_LENS_SHADING_MAP_MODE_ON));
+ }
+ return modes;
+ }
+
+
+ /**
* Get available capabilities and do the sanity check.
*
* @return reported available capabilities list, empty list if the value is unavailable.