Camera HAL Vts : Fix usage flag combination during gralloc allocation.

Earlier, for processCaptureRequestInternal, we took into account
producer and consumer usage flags returned by configureSingleStream.
Instead we should be taking into account the producer flag returned by
configureSingleStream and the consumer flag passed into
processCaptureRequestInternal (for output streams).

Bug: 162344072

Test: Use secure camera as secure only camera and run vts
Test: Run camera vts
Test: Vendor testing

Change-Id: I9fbd4db4cff48c25684f097907e7ba995c3edf41
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index f235235..b0aae8e 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -4453,9 +4453,12 @@
                             nullptr};
         } else {
             allocateGraphicBuffer(testStream.width, testStream.height,
-                    android_convertGralloc1To0Usage(halStreamConfig.streams[0].producerUsage,
-                        halStreamConfig.streams[0].consumerUsage),
-                    halStreamConfig.streams[0].overrideFormat, &buffer_handle);
+                                  /* We don't look at halStreamConfig.streams[0].consumerUsage
+                                   * since that is 0 for output streams
+                                   */
+                                  android_convertGralloc1To0Usage(
+                                          halStreamConfig.streams[0].producerUsage, bufferUsage),
+                                  halStreamConfig.streams[0].overrideFormat, &buffer_handle);
             outputBuffer = {halStreamConfig.streams[0].id,
                             bufferId,
                             buffer_handle,