summaryrefslogtreecommitdiff
path: root/media/libmedia/AudioSystem.cpp
diff options
context:
space:
mode:
author Glenn Kasten <gkasten@google.com> 2012-01-06 16:47:31 -0800
committer Glenn Kasten <gkasten@google.com> 2012-01-10 15:42:32 -0800
commit01aaf2c4010cc7b36e4125256357ec1cb0c29452 (patch)
tree57746ecc4fea6436a94bf42d5958d71d40c97756 /media/libmedia/AudioSystem.cpp
parent38e90751a25606459a9e571aa1b6c992d4c64151 (diff)
Simplify range check for audio_mode_t
AudioSystem::setMode previously allowed negative modes, but these were then rejected by AudioFlinger. Now negative modes (including AUDIO_MODE_INVALID and AUDIO_MODE_CURRENT) are explicitly disallowed. Change-Id: I0bac8fea737c8eb1f5b6afbb893e48739f88d745
Diffstat (limited to 'media/libmedia/AudioSystem.cpp')
-rw-r--r--media/libmedia/AudioSystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index f7f129c30bb8..84f6b7ccce48 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -158,7 +158,7 @@ status_t AudioSystem::getStreamMute(int stream, bool* mute)
status_t AudioSystem::setMode(int mode)
{
- if (mode >= AUDIO_MODE_CNT) return BAD_VALUE;
+ if (uint32_t(mode) >= AUDIO_MODE_CNT) return BAD_VALUE;
const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
if (af == 0) return PERMISSION_DENIED;
return af->setMode(mode);