Merge "Camera: API Gate activePhysicalCameraId during #testRepeatingRaw" into android13-tests-dev am: c9cd1d4f87 am: edcae6af12 am: e10b25a125
Original change: https://android-review.googlesource.com/c/platform/cts/+/2511697
Change-Id: I1e69e5afb80f3d037fd558a708b3cdea9c1ca3ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java b/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java
index 28bb02e..6090cdc 100644
--- a/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java
@@ -59,12 +59,14 @@
import android.media.Image.Plane;
import android.media.ImageReader;
import android.media.ImageWriter;
+import android.os.Build;
import android.os.SystemClock;
import android.os.ConditionVariable;
import android.util.Log;
import android.util.Size;
import android.view.Surface;
+import com.android.compatibility.common.util.PropertyUtil;
import com.android.ex.camera2.blocking.BlockingSessionCallback;
import org.junit.Test;
@@ -1454,7 +1456,9 @@
if (mStaticInfo.isCapabilitySupported(
CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS)) {
StaticMetadata staticInfo = mStaticInfo;
- if (mStaticInfo.isLogicalMultiCamera()
+ boolean supportActivePhysicalIdConsistency =
+ PropertyUtil.getFirstApiLevel() >= Build.VERSION_CODES.S;
+ if (mStaticInfo.isLogicalMultiCamera() && supportActivePhysicalIdConsistency
&& mStaticInfo.isActivePhysicalCameraIdSupported()) {
String activePhysicalId =
result.get(CaptureResult.LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID);