Camera3: Remove explicit active array size addition to configurations

The active array size is added to the supported
sizes through the capabilities from the MCT, hence it will be present
in the available configurations.  No need to add it explicitly in the HAL.

Change-Id: I484d91b19b59b4245cd6f84b869bcac6a75f6f1d
diff --git a/QCamera2/HAL3/QCamera3HWI.cpp b/QCamera2/HAL3/QCamera3HWI.cpp
index 34df7fc..fb134ef 100755
--- a/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/QCamera2/HAL3/QCamera3HWI.cpp
@@ -763,13 +763,6 @@
             }
             break;
         case HAL_PIXEL_FORMAT_BLOB:
-            if (((int32_t)rotatedWidth ==
-                    gCamCapability[mCameraId]->active_array_size.width) &&
-                    ((int32_t)rotatedHeight ==
-                    gCamCapability[mCameraId]->active_array_size.height)) {
-                sizeFound = true;
-                break;
-            }
             count = MIN(gCamCapability[mCameraId]->picture_sizes_tbl_cnt, MAX_SIZES_CNT);
             /* Generate JPEG sizes table */
             makeTable(gCamCapability[mCameraId]->picture_sizes_tbl,
@@ -796,12 +789,22 @@
         case HAL_PIXEL_FORMAT_YCbCr_420_888:
         case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
         default:
-            if (((int32_t)rotatedWidth ==
-                            gCamCapability[mCameraId]->active_array_size.width) &&
-                            ((int32_t)rotatedHeight ==
-                            gCamCapability[mCameraId]->active_array_size.height)) {
-                sizeFound = true;
-                break;
+            if (newStream->stream_type == CAMERA3_STREAM_BIDIRECTIONAL
+                    || newStream->stream_type == CAMERA3_STREAM_INPUT
+                    || newStream->usage & GRALLOC_USAGE_HW_CAMERA_ZSL) {
+                if (((int32_t)rotatedWidth ==
+                                gCamCapability[mCameraId]->active_array_size.width) &&
+                                ((int32_t)rotatedHeight ==
+                                gCamCapability[mCameraId]->active_array_size.height)) {
+                    sizeFound = true;
+                    break;
+                }
+                /* We could potentially break here to enforce ZSL stream
+                 * set from frameworks always is full active array size
+                 * but it is not clear from the spc if framework will always
+                 * follow that, also we have logic to override to full array
+                 * size, so keeping the logic lenient at the moment
+                 */
             }
             count = MIN(gCamCapability[mCameraId]->picture_sizes_tbl_cnt,
                     MAX_SIZES_CNT);
@@ -811,7 +814,7 @@
                             ((int32_t)rotatedHeight ==
                             gCamCapability[mCameraId]->picture_sizes_tbl[i].height)) {
                     sizeFound = true;
-                break;
+                    break;
                 }
             }
             break;
@@ -5257,10 +5260,6 @@
             }
             break;
         case HAL_PIXEL_FORMAT_BLOB:
-            //add the active array size
-            addStreamConfig(available_stream_configs, scalar_formats[j],
-                  active_array_dim,
-                  ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT);
             cam_dimension_t jpeg_size;
             for (size_t i = 0; i < jpeg_sizes_cnt/2; i++) {
                 jpeg_size.width  = available_jpeg_sizes[i*2];
@@ -5275,10 +5274,6 @@
         default:
             cam_dimension_t largest_picture_size;
             memset(&largest_picture_size, 0, sizeof(cam_dimension_t));
-            //add the active array size
-            addStreamConfig(available_stream_configs, scalar_formats[j],
-                    active_array_dim,
-                    ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT);
             for (size_t i = 0; i < gCamCapability[cameraId]->picture_sizes_tbl_cnt; i++) {
                 addStreamConfig(available_stream_configs, scalar_formats[j],
                         gCamCapability[cameraId]->picture_sizes_tbl[i],
@@ -5293,10 +5288,6 @@
             /*For below 2 formats we also support i/p streams for reprocessing advertise those*/
             if (scalar_formats[j] == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED ||
                     scalar_formats[j] == HAL_PIXEL_FORMAT_YCbCr_420_888) {
-                //add the active array size
-                 addStreamConfig(available_stream_configs, scalar_formats[j],
-                         active_array_dim,
-                         ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT);
                  addStreamConfig(available_stream_configs, scalar_formats[j],
                          largest_picture_size,
                          ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT);