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/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index e1bc726..c1ffc87 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -1031,6 +1031,10 @@
     // Adds client logs during closed session to the file pointed by fd.
     void dumpClosedSessionClientLogs(int fd, const std::string& cameraId);
 
+    binder::Status isSessionConfigurationWithParametersSupportedUnsafe(
+            const std::string& cameraId, const SessionConfiguration& sessionConfiguration,
+            bool overrideForPerfClass, /*out*/ bool* supported);
+
     // Mapping from camera ID -> state for each device, map is protected by mCameraStatesLock
     std::map<std::string, std::shared_ptr<CameraState>> mCameraStates;