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

Commit a38ed905 authored by irii's avatar irii Committed by Ivan Ivanich
Browse files

libcameraservice: Don't pass NULL args on setCallbacks call

*This fixes the torch light for cameras with hal 1

*This fix works on the htc m7ul

*Fixed line length
*Fixed unused parameter names

Change-Id: I89c6112546e36dbcca099f4d5cd70371b2c5340a
(cherry picked from commit 3f6bb688)
parent 62661dce
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -846,6 +846,18 @@ status_t CameraHardwareInterfaceFlashControl::initializePreviewWindow(
    return device->setPreviewWindow(mSurface);
}

static void notifyCallback(int32_t, int32_t, int32_t, void*) {
    /* Empty */
}

static void dataCallback(int32_t, const sp<IMemory>&, camera_frame_metadata_t*, void*) {
    /* Empty */
}

static void dataCallbackTimestamp(nsecs_t, int32_t, const sp<IMemory>&, void*) {
    /* Empty */
}

status_t CameraHardwareInterfaceFlashControl::connectCameraDevice(
        const String8& cameraId) {
    sp<CameraHardwareInterface> device =
@@ -859,7 +871,7 @@ status_t CameraHardwareInterfaceFlashControl::connectCameraDevice(
    }

    // need to set __get_memory in set_callbacks().
    device->setCallbacks(NULL, NULL, NULL, NULL);
    device->setCallbacks(notifyCallback, dataCallback, dataCallbackTimestamp, this);

    mParameters = device->getParameters();