Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 221f7b2d authored by Jayant Chowdhary's avatar Jayant Chowdhary
Browse files

camera2 ndk: Allow nullptr for ACameraCaptureSession_captureCallbacks.onClosed.



Bug: 134680093
Bug: 146357162

Test: AImageReaderVendorTest

Merged-In: I8d365b434c257e949496d9495d0fa31a18a2e068
Change-Id: I8d365b434c257e949496d9495d0fa31a18a2e068
Signed-off-by: default avatarJayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 9da975d8)
parent f12b7622
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -33,7 +33,9 @@ ACameraCaptureSession::~ACameraCaptureSession() {
        dev->unlockDevice();
    }
    // Fire onClosed callback
    if (mUserSessionCallback.onClosed != nullptr) {
        (*mUserSessionCallback.onClosed)(mUserSessionCallback.context, this);
    }
    ALOGV("~ACameraCaptureSession: %p is deleted", this);
}

+2 −14
Original line number Diff line number Diff line
@@ -253,21 +253,9 @@ class CameraHelper {
        return true;
    }

    static void onDeviceDisconnected(void* /*obj*/, ACameraDevice* /*device*/) {}

    static void onDeviceError(void* /*obj*/, ACameraDevice* /*device*/, int /*errorCode*/) {}

    static void onSessionClosed(void* /*obj*/, ACameraCaptureSession* /*session*/) {}

    static void onSessionReady(void* /*obj*/, ACameraCaptureSession* /*session*/) {}

    static void onSessionActive(void* /*obj*/, ACameraCaptureSession* /*session*/) {}

   private:
    ACameraDevice_StateCallbacks mDeviceCb{this, onDeviceDisconnected,
                                           onDeviceError};
    ACameraCaptureSession_stateCallbacks mSessionCb{
        this, onSessionClosed, onSessionReady, onSessionActive};
    ACameraDevice_StateCallbacks mDeviceCb{this, nullptr, nullptr};
    ACameraCaptureSession_stateCallbacks mSessionCb{ this, nullptr, nullptr, nullptr};

    native_handle_t* mImgReaderAnw = nullptr;  // not owned by us.