diff options
author | Chih-Chung Chang <chihchung@google.com> | 2011-10-07 03:20:26 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-07 03:20:26 -0700 |
commit | 17f254105b399c7a4216da2d477e7f9cbdbd7319 (patch) | |
tree | 8e07078c56028499010422825a01eca37a8a1e8d /services/camera/libcameraservice/CameraService.cpp | |
parent | 3c02c12c73fa8719e49a5da6534750196efe3eba (diff) | |
parent | 9143aaafeefae694cb4210eb1590b0b151618734 (diff) | |
download | frameworks_base-17f254105b399c7a4216da2d477e7f9cbdbd7319.zip frameworks_base-17f254105b399c7a4216da2d477e7f9cbdbd7319.tar.gz frameworks_base-17f254105b399c7a4216da2d477e7f9cbdbd7319.tar.bz2 |
Merge "Allow shutter/recording sound to be adjusted unless it's forced."
Diffstat (limited to 'services/camera/libcameraservice/CameraService.cpp')
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 9f7bd27..05e7bcf 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -278,9 +278,20 @@ void CameraService::setCameraFree(int cameraId) { // media players. static MediaPlayer* newMediaPlayer(const char *file) { + // Read the system property to determine if we have need to use the + // AUDIO_STREAM_ENFORCED_AUDIBLE type. + char value[PROPERTY_VALUE_MAX]; + property_get("ro.camera.sound.forced", value, "0"); + int audioStreamType; + if (strcmp(value, "0") != 0) { + audioStreamType = AUDIO_STREAM_ENFORCED_AUDIBLE; + } else { + audioStreamType = AUDIO_STREAM_MUSIC; + } + MediaPlayer* mp = new MediaPlayer(); if (mp->setDataSource(file, NULL) == NO_ERROR) { - mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE); + mp->setAudioStreamType(audioStreamType); mp->prepare(); } else { LOGE("Failed to load CameraService sounds: %s", file); |