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

Commit efbc4847 authored by Luis GarciaCalderon's avatar Luis GarciaCalderon Committed by Giulio Cervera
Browse files

frameworks/base: Added property to disable Camcorder/Camera sounds

Change-Id: I05d7da1d639529f21e06da09b07c87597c4f1029
parent 92577269
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);