diff options
| author | 2012-01-06 16:47:31 -0800 | |
|---|---|---|
| committer | 2012-01-10 15:42:32 -0800 | |
| commit | 01aaf2c4010cc7b36e4125256357ec1cb0c29452 (patch) | |
| tree | 57746ecc4fea6436a94bf42d5958d71d40c97756 /services/audioflinger/AudioPolicyService.cpp | |
| parent | 38e90751a25606459a9e571aa1b6c992d4c64151 (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 'services/audioflinger/AudioPolicyService.cpp')
| -rw-r--r-- | services/audioflinger/AudioPolicyService.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp index f572fcebf417..3f86d58e6929 100644 --- a/services/audioflinger/AudioPolicyService.cpp +++ b/services/audioflinger/AudioPolicyService.cpp @@ -193,7 +193,7 @@ status_t AudioPolicyService::setPhoneState(int state) if (!checkPermission()) { return PERMISSION_DENIED; } - if (state < 0 || state >= AUDIO_MODE_CNT) { + if (uint32_t(state) >= AUDIO_MODE_CNT) { return BAD_VALUE; } |