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

Commit 46c08c0d authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "frameworks/base: Added property to disable Camcorder/Camera sounds" into gingerbread

parents 2122f6e8 efbc4847
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@
#include "gralloc_priv.h"
#endif

#include <cutils/properties.h>

namespace android {

// ----------------------------------------------------------------------------
@@ -336,9 +338,19 @@ void CameraService::loadSound() {
    LOG1("CameraService::loadSound ref=%d", mSoundRef);
    if (mSoundRef++) return;

    char value[PROPERTY_VALUE_MAX];
    property_get("persist.camera.shutter.disable", value, "0");
    int disableSound = atoi(value);

    if(!disableSound) {
        mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg");
        mSoundPlayer[SOUND_RECORDING] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
    }
    else {
        mSoundPlayer[SOUND_SHUTTER] = NULL;
        mSoundPlayer[SOUND_RECORDING] = NULL;
    }
}

void CameraService::releaseSound() {
    Mutex::Autolock lock(mSoundLock);