Camera: Handle case where only physical camera supports RAW

If logical camera doesn't have RAW capability whereas its physical
cameras do, camera device must support concurrent streaming of RAW
streams from the physical cameras.

Fix a case where for stream combination of [PRIVATE_physical_1,
PRIVATE_physical_2, RAW], RAW stream shouldn't be configured for the
logical camera.

Test: testMandatoryOutputCombinations for logical camera
Bug: 111288509
Change-Id: I886e2c999f30d61b0889b7ccd002275270398d0f
Merged-In: I886e2c999f30d61b0889b7ccd002275270398d0f
diff --git a/tests/camera/src/android/hardware/camera2/cts/RobustnessTest.java b/tests/camera/src/android/hardware/camera2/cts/RobustnessTest.java
index cce6171..47020ed 100644
--- a/tests/camera/src/android/hardware/camera2/cts/RobustnessTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/RobustnessTest.java
@@ -2010,15 +2010,20 @@
                     case RAW: {
                         Size targetSize = (numConfigs == 1) ? maxSizes.maxRawSize :
                                 overridePhysicalCameraSizes.get(j);
-                        ImageReader target = ImageReader.newInstance(
-                            targetSize.getWidth(), targetSize.getHeight(), RAW, numBuffers);
-                        target.setOnImageAvailableListener(imageDropperListener, mHandler);
-                        OutputConfiguration config = new OutputConfiguration(target.getSurface());
-                        if (numConfigs > 1) {
-                            config.setPhysicalCameraId(overridePhysicalCameraIds.get(j));
+                        // targetSize could be null in the logical camera case where only
+                        // physical camera supports RAW stream.
+                        if (targetSize != null) {
+                            ImageReader target = ImageReader.newInstance(
+                                targetSize.getWidth(), targetSize.getHeight(), RAW, numBuffers);
+                            target.setOnImageAvailableListener(imageDropperListener, mHandler);
+                            OutputConfiguration config =
+                                    new OutputConfiguration(target.getSurface());
+                            if (numConfigs > 1) {
+                                config.setPhysicalCameraId(overridePhysicalCameraIds.get(j));
+                            }
+                            outputConfigs.add(config);
+                            rawTargets.add(target);
                         }
-                        outputConfigs.add(config);
-                        rawTargets.add(target);
                         break;
                     }
                     default: