diff options
-rw-r--r-- | camera/libcameraservice/CameraService.cpp | 35 | ||||
-rw-r--r-- | camera/libcameraservice/CameraService.h | 2 |
2 files changed, 15 insertions, 22 deletions
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp index 738821c..b9bf5f8 100644 --- a/camera/libcameraservice/CameraService.cpp +++ b/camera/libcameraservice/CameraService.cpp @@ -985,39 +985,32 @@ status_t CameraService::Client::takePicture() // snapshot taken void CameraService::Client::handleShutter( - image_rect_type *size, // The width and height of yuv picture for + image_rect_type *size // The width and height of yuv picture for // registerBuffer. If this is NULL, use the picture // size from parameters. - bool playShutterSoundOnly ) { // Play shutter sound. - - if(playShutterSoundOnly) { - - if (mMediaPlayerClick.get() != NULL) { - // do not play shutter sound if stream volume is 0 - // (typically because ringer mode is silent). - int index; - AudioSystem::getStreamVolumeIndex(AudioSystem::ENFORCED_AUDIBLE, &index); - if (index != 0) { - mMediaPlayerClick->seekTo(0); - mMediaPlayerClick->start(); - } - } - sp<ICameraClient> c = mCameraClient; - if (c != NULL) { - c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0); + if (mMediaPlayerClick.get() != NULL) { + // do not play shutter sound if stream volume is 0 + // (typically because ringer mode is silent). + int index; + AudioSystem::getStreamVolumeIndex(AudioSystem::ENFORCED_AUDIBLE, &index); + if (index != 0) { + mMediaPlayerClick->seekTo(0); + mMediaPlayerClick->start(); } - return ; } - // Screen goes black after the buffer is unregistered. if (mSurface != 0 && !mUseOverlay) { mSurface->unregisterBuffers(); } + sp<ICameraClient> c = mCameraClient; + if (c != NULL) { + c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0); + } mHardware->disableMsgType(CAMERA_MSG_SHUTTER); // It takes some time before yuvPicture callback to be called. @@ -1192,7 +1185,7 @@ void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1, int32_ switch (msgType) { case CAMERA_MSG_SHUTTER: // ext1 is the dimension of the yuv picture. - client->handleShutter((image_rect_type *)ext1, (bool)ext2); + client->handleShutter((image_rect_type *)ext1); break; default: sp<ICameraClient> c = client->mCameraClient; diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h index 08dae31..95d11b4 100644 --- a/camera/libcameraservice/CameraService.h +++ b/camera/libcameraservice/CameraService.h @@ -150,7 +150,7 @@ private: static sp<Client> getClientFromCookie(void* user); void handlePreviewData(const sp<IMemory>&); - void handleShutter(image_rect_type *image, bool playShutterSoundOnly); + void handleShutter(image_rect_type *image); void handlePostview(const sp<IMemory>&); void handleRawPicture(const sp<IMemory>&); void handleCompressedPicture(const sp<IMemory>&); |