diff options
author | Chih-Chung Chang <chihchung@google.com> | 2011-10-07 13:37:42 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2011-10-07 13:39:18 +0800 |
commit | 9143aaafeefae694cb4210eb1590b0b151618734 (patch) | |
tree | 0d9f75530233d7d35685e37fe7d934df9caaee4a /services/camera/libcameraservice/CameraService.cpp | |
parent | 5e3cdc765536ded778f3be81dc923c3af3c680a1 (diff) | |
download | frameworks_base-9143aaafeefae694cb4210eb1590b0b151618734.zip frameworks_base-9143aaafeefae694cb4210eb1590b0b151618734.tar.gz frameworks_base-9143aaafeefae694cb4210eb1590b0b151618734.tar.bz2 |
Allow shutter/recording sound to be adjusted unless it's forced.
Change-Id: I7080d5f50a87f92c8e9395d4cf8f927a6760fa70
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 b178fd9..615822c 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); |