diff options
author | Eric Laurent <> | 2009-03-27 18:18:46 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-27 18:18:46 -0700 |
commit | 933a9418d95f871c66a3202a71d1815b3b0d24f9 (patch) | |
tree | 10560743ea2bf036899e083cf968cc042c6edd6b /libs | |
parent | 253ed06781698a14aa838327d4d1135a11e01e3a (diff) | |
download | frameworks_native-933a9418d95f871c66a3202a71d1815b3b0d24f9.zip frameworks_native-933a9418d95f871c66a3202a71d1815b3b0d24f9.tar.gz frameworks_native-933a9418d95f871c66a3202a71d1815b3b0d24f9.tar.bz2 |
AI 143327: am: CL 143177 am: CL 142889 Fix issue #1736153 Camera shutter sound can be muted by new AlarmClock setting.
Current implementation of Camera service plays the camera shutter sound over the ALARM stream so that it cannot be muted by silent mode in order to comply to some country specific requirement. A recent change made it possible for the user to mute the ALARM stream thus making this stream not suitable any more for the camera shutter sound.
The fix consists in creating a new stream type only accessible by native code and that cannot be muted and use it to play camera sounds.
Original author: elaurent
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...
Automated import of CL 143327
Diffstat (limited to 'libs')
-rw-r--r-- | libs/audioflinger/AudioFlinger.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp index 9ba7f90..b9ecdd8 100644 --- a/libs/audioflinger/AudioFlinger.cpp +++ b/libs/audioflinger/AudioFlinger.cpp @@ -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) @@ -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; } @@ -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; } |