summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-11 11:38:21 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-01-11 11:38:21 -0800
commit1eac460122c94455d28d4189ce12e23794b04148 (patch)
tree023d36a5178874a36d8a6625ee55a3a57e37afe4 /services/audioflinger
parentd742fa3f6074f52225cbea5acabb3404067e9d6a (diff)
parent01aaf2c4010cc7b36e4125256357ec1cb0c29452 (diff)
downloadframeworks_base-1eac460122c94455d28d4189ce12e23794b04148.zip
frameworks_base-1eac460122c94455d28d4189ce12e23794b04148.tar.gz
frameworks_base-1eac460122c94455d28d4189ce12e23794b04148.tar.bz2
Merge "Simplify range check for audio_mode_t"
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/AudioFlinger.cpp2
-rw-r--r--services/audioflinger/AudioPolicyService.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index b238979..9fb666e 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -574,7 +574,7 @@ status_t AudioFlinger::setMode(int mode)
if (!settingsAllowed()) {
return PERMISSION_DENIED;
}
- if ((mode < 0) || (mode >= AUDIO_MODE_CNT)) {
+ if (uint32_t(mode) >= AUDIO_MODE_CNT) {
ALOGW("Illegal value: setMode(%d)", mode);
return BAD_VALUE;
}
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index f572fce..3f86d58 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;
}