Implement session param injection in CameraService
- This allows injecting session params into existing camera clients.
- The injection is cleared upon the camera closing, and we do not keep
state from one camera open to the next.
- We restrict the injection to only allow overriding vendor tags for now.
- The actionable parts of the change are gated behind the inject_session_params
flag to allow easy flipping. When false, this feature will have no effect.
Bug: 308984721
Test: I tested that this works using adb shell.
Change-Id: I27d955d035dde57b63a220c5d68b505ec636c401
diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.h b/services/camera/libcameraservice/common/Camera2ClientBase.h
index bac4af8..2bb90d9 100644
--- a/services/camera/libcameraservice/common/Camera2ClientBase.h
+++ b/services/camera/libcameraservice/common/Camera2ClientBase.h
@@ -18,6 +18,7 @@
#define ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_BASE_H
#include "common/CameraDeviceBase.h"
+#include "camera/CameraMetadata.h"
#include "camera/CaptureResult.h"
#include "utils/CameraServiceProxyWrapper.h"
#include "CameraServiceWatchdog.h"
@@ -136,6 +137,8 @@
sp<CameraProviderManager> manager) override;
status_t stopInjection() override;
+ status_t injectSessionParams(const CameraMetadata& sessionParams) override;
+
protected:
// The PID provided in the constructor call