diff options
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 87027f7..f512db2 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -655,6 +655,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; @@ -683,6 +688,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; |