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

Commit 9ff25ced authored by Igor Murashkin's avatar Igor Murashkin Committed by Android Git Automerger
Browse files

am 557847ee: am a6ca0acf: am bd3e2e03: camera2: Fix segfault when using null availability listener

* commit '557847ee':
  camera2: Fix segfault when using null availability listener
parents 31486911 557847ee
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -719,6 +719,11 @@ status_t CameraService::addListener(
                                const sp<ICameraServiceListener>& listener) {
    ALOGV("%s: Add listener %p", __FUNCTION__, listener.get());

    if (listener == 0) {
        ALOGE("%s: Listener must not be null", __FUNCTION__);
        return BAD_VALUE;
    }

    Mutex::Autolock lock(mServiceLock);

    Vector<sp<ICameraServiceListener> >::iterator it, end;
@@ -747,6 +752,11 @@ status_t CameraService::removeListener(
                                const sp<ICameraServiceListener>& listener) {
    ALOGV("%s: Remove listener %p", __FUNCTION__, listener.get());

    if (listener == 0) {
        ALOGE("%s: Listener must not be null", __FUNCTION__);
        return BAD_VALUE;
    }

    Mutex::Autolock lock(mServiceLock);

    Vector<sp<ICameraServiceListener> >::iterator it;