diff options
author | Eric Laurent <elaurent@google.com> | 2009-11-27 05:07:55 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2009-11-27 05:07:55 -0800 |
commit | 059b413e652b704c80386779641603d2bef8197a (patch) | |
tree | de138451bff83196de14beaf931bda339154135e /camera | |
parent | 8f80ef11352e6dab3e43bc14a6c76888278e9c93 (diff) | |
download | frameworks_native-059b413e652b704c80386779641603d2bef8197a.zip frameworks_native-059b413e652b704c80386779641603d2bef8197a.tar.gz frameworks_native-059b413e652b704c80386779641603d2bef8197a.tar.bz2 |
Fix issue 2192673: Music Pausing Even when notifications are set to silent.
Do not play ringtones, notifications or camera sounds if ringer mode is silent.
Diffstat (limited to 'camera')
-rw-r--r-- | camera/libcameraservice/CameraService.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp index df59dcf..6419a5c 100644 --- a/camera/libcameraservice/CameraService.cpp +++ b/camera/libcameraservice/CameraService.cpp @@ -669,8 +669,14 @@ status_t CameraService::Client::startRecording() LOGD("startRecording (pid %d)", getCallingPid()); if (mMediaPlayerBeep.get() != NULL) { - mMediaPlayerBeep->seekTo(0); - mMediaPlayerBeep->start(); + // do not play record jingle if stream volume is 0 + // (typically because ringer mode is silent). + int index; + AudioSystem::getStreamVolumeIndex(AudioSystem::ENFORCED_AUDIBLE, &index); + if (index != 0) { + mMediaPlayerBeep->seekTo(0); + mMediaPlayerBeep->start(); + } } mHardware->enableMsgType(CAMERA_MSG_VIDEO_FRAME); @@ -888,8 +894,14 @@ void CameraService::Client::handleShutter( { // Play shutter sound. if (mMediaPlayerClick.get() != NULL) { - mMediaPlayerClick->seekTo(0); - mMediaPlayerClick->start(); + // 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(); + } } // Screen goes black after the buffer is unregistered. |