ACameraCaptureSession_setWindowPreparedCallback API council feedback

Bug: 272101012

Test: atest NativeCameraDeviceTest.java

Change-Id: I82db079fb2fa8a3e999f29601977f15cab333a9b
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
diff --git a/camera/ndk/impl/ACameraCaptureSession.h b/camera/ndk/impl/ACameraCaptureSession.h
index 145473b..88135ba 100644
--- a/camera/ndk/impl/ACameraCaptureSession.h
+++ b/camera/ndk/impl/ACameraCaptureSession.h
@@ -75,6 +75,17 @@
 };
 
 /**
+ * Capture session state callbacks used in {@link ACameraDevice_setPrepareCallbacks}
+ */
+typedef struct ACameraCaptureSession_prepareCallbacks {
+    /// optional application context. This will be passed in the context
+    /// parameter of the {@link onWindowPrepared} callback.
+    void*                               context;
+
+    ACameraCaptureSession_prepareCallback onWindowPrepared;
+} ACameraCaptureSession_prepareCallbacks;
+
+/**
  * ACameraCaptureSession opaque struct definition
  * Leave outside of android namespace because it's NDK struct
  */
@@ -130,9 +141,11 @@
 
     camera_status_t updateOutputConfiguration(ACaptureSessionOutput *output);
 
-    void setWindowPreparedCallback(ACameraCaptureSession_prepareCallbacks *cb) {
+    void setWindowPreparedCallback(void *context,
+            ACameraCaptureSession_prepareCallback cb) {
         Mutex::Autolock _l(mSessionLock);
-        mPreparedCb = *cb;
+        mPreparedCb.context = context;
+        mPreparedCb.onWindowPrepared = cb;
     }
     camera_status_t prepare(ACameraWindowType *window);