diff options
author | Natalie Silvanovich <natashenka@google.com> | 2014-05-01 22:03:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-01 22:03:58 +0000 |
commit | e872a2f69f4076f7ae5cd19b95b4bf9784e183e1 (patch) | |
tree | 7570c62185d84a090ec0ab054ed375688b191751 /media | |
parent | edfb6b6b747e09334c102bff7cb2c4f8a8c86129 (diff) | |
parent | 559c76dbc37ff25b204ed1f060d3ec2fa43d718c (diff) | |
download | frameworks_base-e872a2f69f4076f7ae5cd19b95b4bf9784e183e1.zip frameworks_base-e872a2f69f4076f7ae5cd19b95b4bf9784e183e1.tar.gz frameworks_base-e872a2f69f4076f7ae5cd19b95b4bf9784e183e1.tar.bz2 |
Merge "Bounds Check in onPlaySoundEffect"
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/AudioService.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 4513ead..0c8a823 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -1787,6 +1787,11 @@ public class AudioService extends IAudioService.Stub { /** @see AudioManager#playSoundEffect(int, float) */ public void playSoundEffectVolume(int effectType, float volume) { + if (effectType >= AudioManager.NUM_SOUND_EFFECTS || effectType < 0) { + Log.w(TAG, "AudioService effectType value " + effectType + " out of range"); + return; + } + sendMsg(mAudioHandler, MSG_PLAY_SOUND_EFFECT, SENDMSG_QUEUE, effectType, (int) (volume * 1000), null, 0); } |