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

Commit 059b413e authored by Eric Laurent's avatar Eric Laurent
Browse files

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.
parent 8f80ef11
Loading
Loading
Loading
Loading
+16 −4
Original line number Original line Diff line number Diff line
@@ -669,9 +669,15 @@ status_t CameraService::Client::startRecording()
    LOGD("startRecording (pid %d)", getCallingPid());
    LOGD("startRecording (pid %d)", getCallingPid());


    if (mMediaPlayerBeep.get() != NULL) {
    if (mMediaPlayerBeep.get() != NULL) {
        // 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->seekTo(0);
            mMediaPlayerBeep->start();
            mMediaPlayerBeep->start();
        }
        }
    }


    mHardware->enableMsgType(CAMERA_MSG_VIDEO_FRAME);
    mHardware->enableMsgType(CAMERA_MSG_VIDEO_FRAME);


@@ -888,9 +894,15 @@ void CameraService::Client::handleShutter(
{
{
    // Play shutter sound.
    // Play shutter sound.
    if (mMediaPlayerClick.get() != NULL) {
    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->seekTo(0);
            mMediaPlayerClick->start();
            mMediaPlayerClick->start();
        }
        }
    }


    // Screen goes black after the buffer is unregistered.
    // Screen goes black after the buffer is unregistered.
    if (mSurface != 0 && !mUseOverlay) {
    if (mSurface != 0 && !mUseOverlay) {