From 01aaf2c4010cc7b36e4125256357ec1cb0c29452 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Fri, 6 Jan 2012 16:47:31 -0800 Subject: 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 --- services/audioflinger/AudioPolicyService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/audioflinger/AudioPolicyService.cpp') 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; } -- cgit v1.2.3-59-g8ed1b