Camera ITS: Fix its execution failed
This is related to the bug: 149534111.
In case a physical camera that contains only DEPTH information is
included in a logical camera, evaluating the DEPTH camera is
inappropriate because depth only camera doesn't have
backward-compatible capability.
However, this test does not check backward-compatible capability,
and this leads the phone crashed.
To avoid the crash, adding check for backward-compatible
capability is necessary.
Bug: 151408617
Test: ITS build and execution
Change-Id: I62993c1a9c9d66bb17c82a859396066fafbbf510
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsUtils.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsUtils.java
index cd739b5..36a10f4 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsUtils.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsUtils.java
@@ -375,7 +375,7 @@
CameraCharacteristics physicalChar =
manager.getCameraCharacteristics(physicalId);
- hwLevel = characteristics.get(
+ hwLevel = physicalChar.get(
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
if (hwLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY ||
hwLevel ==
@@ -384,6 +384,18 @@
continue;
}
+ int[] physicalActualCapabilities = physicalChar.get(
+ CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES);
+ boolean physicalHaveBC = false;
+ for (int capability : physicalActualCapabilities) {
+ if (capability == BACKWARD_COMPAT) {
+ physicalHaveBC = true;
+ break;
+ }
+ }
+ if (!physicalHaveBC) {
+ continue;
+ }
// To reduce duplicate tests, only additionally test hidden physical cameras
// with different focal length compared to the default focal length of the
// logical camera.