From 42d63ad24c833cb63658de246d4953df24671a63 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Tue, 14 Dec 2010 05:38:09 -0500 Subject: libcameraservice: Remove references to playShutterSoundOnly Removing cruft from a CAF patch. This fixes the shutter sound. Change-Id: Ibefb50e7404a8a73336ae055ca0f6e815aed909b --- camera/libcameraservice/CameraService.cpp | 35 +++++++++++++------------------ 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 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 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 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 getClientFromCookie(void* user); void handlePreviewData(const sp&); - void handleShutter(image_rect_type *image, bool playShutterSoundOnly); + void handleShutter(image_rect_type *image); void handlePostview(const sp&); void handleRawPicture(const sp&); void handleCompressedPicture(const sp&); -- cgit v1.1