cameraservice: Check for session support before getting
session characteristics

The current implementation of getSessionCharacteristics was not
clear on what the return value of unsupported SessionConfigurations
should be and left the error reporting to the HAL.

With this CL, getSessionCharacteristics checks for
SessionConfiguration before requesting SessionCharacteristics from
the HAL, and returns ERROR_ILLEGAL_ARGUMENT if the
SessionConfiguration is not supported.

Bug: 327008530
Test: atest android.hardware.camera2.cts.CameraDeviceSetupTest passes
Change-Id: I084dca0a99e68b2345bdcc1a850e7f142074cca4
diff --git a/camera/camera_platform.aconfig b/camera/camera_platform.aconfig
index 883dac0..4005c6a 100644
--- a/camera/camera_platform.aconfig
+++ b/camera/camera_platform.aconfig
@@ -190,3 +190,13 @@
        purpose: PURPOSE_BUGFIX
      }
 }
+
+flag {
+     namespace: "camera_platform"
+     name: "check_session_support_before_session_char"
+     description: "Validate that a SessionConfiguration is supported before fetching SessionCharacteristics."
+     bug: "327008530"
+     metadata {
+       purpose: PURPOSE_BUGFIX
+     }
+}