Bounds Check in onPlaySoundEffect
Prevents system crash Bug: 13514877 Change-Id: Id03561779611d9eb7402ff206fd877b39bb2f035
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user