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/NdkCameraCaptureSession.cpp b/camera/ndk/NdkCameraCaptureSession.cpp
index e6c876b..4387cc6 100644
--- a/camera/ndk/NdkCameraCaptureSession.cpp
+++ b/camera/ndk/NdkCameraCaptureSession.cpp
@@ -194,24 +194,19 @@
 
 EXPORT
 camera_status_t ACameraCaptureSession_setWindowPreparedCallback(
-        ACameraCaptureSession* session, ACameraCaptureSession_prepareCallbacks *cb) {
+        ACameraCaptureSession* session, void *context,
+        ACameraCaptureSession_prepareCallback cb) {
     ATRACE_CALL();
     if (session == nullptr || cb == nullptr) {
         ALOGE("%s: Error: session %p / callback %p is null", __FUNCTION__, session, cb);
         return ACAMERA_ERROR_INVALID_PARAMETER;
     }
 
-    if (cb->reserved0 != nullptr || cb->reserved1 != nullptr) {
-         ALOGE("%s: Setting reserved 0 and reserved 1 fields of "
-               "ACameraCaptureSession_prepareCallbacks is currently not supported "
-               " .They must be set to  null", __FUNCTION__);
-        return ACAMERA_ERROR_INVALID_PARAMETER;
-    }
     if (session->isClosed()) {
         ALOGE("%s: session %p is already closed", __FUNCTION__, session);
         return ACAMERA_ERROR_SESSION_CLOSED;
     }
-    session->setWindowPreparedCallback(cb);
+    session->setWindowPreparedCallback(context, cb);
     return ACAMERA_OK;
 }