Loading camera/libcameraservice/CameraService.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ #include <media/AudioSystem.h> #include "CameraService.h" #include <cutils/properties.h> namespace android { extern "C" { Loading Loading @@ -157,7 +159,13 @@ static sp<MediaPlayer> newMediaPlayer(const char *file) { sp<MediaPlayer> mp = new MediaPlayer(); if (mp->setDataSource(file) == NO_ERROR) { mp->setAudioStreamType(AudioSystem::ALARM); char value[PROPERTY_VALUE_MAX]; property_get("ro.camera.sound.forced", value, "0"); if (atoi(value)) { mp->setAudioStreamType(AudioSystem::ENFORCED_AUDIBLE); } else { mp->setAudioStreamType(AudioSystem::SYSTEM); } mp->prepare(); } else { mp.clear(); Loading libs/audioflinger/AudioFlinger.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -243,7 +243,8 @@ bool AudioFlinger::streamForcedToSpeaker(int streamType) // AudioSystem::routedToA2dpOutput(streamType) == false return (streamType == AudioSystem::RING || streamType == AudioSystem::ALARM || streamType == AudioSystem::NOTIFICATION); streamType == AudioSystem::NOTIFICATION || streamType == AudioSystem::ENFORCED_AUDIBLE); } status_t AudioFlinger::dumpClients(int fd, const Vector<String16>& args) Loading Loading @@ -645,7 +646,8 @@ status_t AudioFlinger::setStreamVolume(int stream, float value) return PERMISSION_DENIED; } if (uint32_t(stream) >= AudioSystem::NUM_STREAM_TYPES) { if (uint32_t(stream) >= AudioSystem::NUM_STREAM_TYPES || uint32_t(stream) == AudioSystem::ENFORCED_AUDIBLE) { return BAD_VALUE; } Loading Loading @@ -680,7 +682,8 @@ status_t AudioFlinger::setStreamMute(int stream, bool muted) return PERMISSION_DENIED; } if (uint32_t(stream) >= AudioSystem::NUM_STREAM_TYPES) { if (uint32_t(stream) >= AudioSystem::NUM_STREAM_TYPES || uint32_t(stream) == AudioSystem::ENFORCED_AUDIBLE) { return BAD_VALUE; } Loading Loading
camera/libcameraservice/CameraService.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ #include <media/AudioSystem.h> #include "CameraService.h" #include <cutils/properties.h> namespace android { extern "C" { Loading Loading @@ -157,7 +159,13 @@ static sp<MediaPlayer> newMediaPlayer(const char *file) { sp<MediaPlayer> mp = new MediaPlayer(); if (mp->setDataSource(file) == NO_ERROR) { mp->setAudioStreamType(AudioSystem::ALARM); char value[PROPERTY_VALUE_MAX]; property_get("ro.camera.sound.forced", value, "0"); if (atoi(value)) { mp->setAudioStreamType(AudioSystem::ENFORCED_AUDIBLE); } else { mp->setAudioStreamType(AudioSystem::SYSTEM); } mp->prepare(); } else { mp.clear(); Loading
libs/audioflinger/AudioFlinger.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -243,7 +243,8 @@ bool AudioFlinger::streamForcedToSpeaker(int streamType) // AudioSystem::routedToA2dpOutput(streamType) == false return (streamType == AudioSystem::RING || streamType == AudioSystem::ALARM || streamType == AudioSystem::NOTIFICATION); streamType == AudioSystem::NOTIFICATION || streamType == AudioSystem::ENFORCED_AUDIBLE); } status_t AudioFlinger::dumpClients(int fd, const Vector<String16>& args) Loading Loading @@ -645,7 +646,8 @@ status_t AudioFlinger::setStreamVolume(int stream, float value) return PERMISSION_DENIED; } if (uint32_t(stream) >= AudioSystem::NUM_STREAM_TYPES) { if (uint32_t(stream) >= AudioSystem::NUM_STREAM_TYPES || uint32_t(stream) == AudioSystem::ENFORCED_AUDIBLE) { return BAD_VALUE; } Loading Loading @@ -680,7 +682,8 @@ status_t AudioFlinger::setStreamMute(int stream, bool muted) return PERMISSION_DENIED; } if (uint32_t(stream) >= AudioSystem::NUM_STREAM_TYPES) { if (uint32_t(stream) >= AudioSystem::NUM_STREAM_TYPES || uint32_t(stream) == AudioSystem::ENFORCED_AUDIBLE) { return BAD_VALUE; } Loading