Skip to content

Commit

Permalink
Forward Port: Add Camera sound toggle [3/3]
Browse files Browse the repository at this point in the history
Change-Id: I3ac951967f8403252c7f944fcbde927ee75608e6
  • Loading branch information
mnm9994u authored and xlxfoxxlx committed Jun 10, 2017
1 parent 66b410a commit dac1f8b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions services/camera/libcameraservice/CameraService.cpp
Expand Up @@ -1989,9 +1989,19 @@ void CameraService::loadSound() {
LOG1("CameraService::loadSound ref=%d", mSoundRef);
if (mSoundRef++) return;

mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg");
mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
mSoundPlayer[SOUND_RECORDING_STOP] = newMediaPlayer("/system/media/audio/ui/VideoStop.ogg");
char value[PROPERTY_VALUE_MAX];
property_get("persist.sys.camera-sound", value, "1");

if (atoi(value)) {
mSoundPlayer[SOUND_SHUTTER] = newMediaPlayer("/system/media/audio/ui/camera_click.ogg");
mSoundPlayer[SOUND_RECORDING_START] = newMediaPlayer("/system/media/audio/ui/VideoRecord.ogg");
mSoundPlayer[SOUND_RECORDING_STOP] = newMediaPlayer("/system/media/audio/ui/VideoStop.ogg");
} else {
mSoundPlayer[SOUND_SHUTTER] = NULL;
mSoundPlayer[SOUND_RECORDING_START] = NULL;
mSoundPlayer[SOUND_RECORDING_STOP] = NULL;
}

}

void CameraService::releaseSound() {
Expand Down

0 comments on commit dac1f8b

Please sign in to comment.