Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e872a2f6 authored by Natalie Silvanovich's avatar Natalie Silvanovich Committed by Android (Google) Code Review
Browse files

Merge "Bounds Check in onPlaySoundEffect"

parents edfb6b6b 559c76db
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
    }