FileDocCategorySizeDatePackage
TonePlayer.javaAPI DocAndroid 1.5 API2633Wed May 06 22:42:48 BST 2009com.android.stk

TonePlayer

public class TonePlayer extends Object
Class that implements a tones player for the SIM toolkit application.

Fields Summary
private static final HashMap
mToneMap
private android.media.ToneGenerator
mToneGenerator
Constructors Summary
TonePlayer()


     
        mToneGenerator = new ToneGenerator(AudioManager.STREAM_SYSTEM, 100);
    
Methods Summary
private intgetToneId(com.android.internal.telephony.gsm.stk.Tone tone)

        int toneId = ToneGenerator.TONE_PROP_BEEP;

        if (tone != null && mToneMap.containsKey(tone)) {
            toneId = mToneMap.get(tone);
        }
        return toneId;
    
public voidplay(com.android.internal.telephony.gsm.stk.Tone tone)

        int toneId = getToneId(tone);
        if (toneId > 0 && mToneGenerator != null) {
            mToneGenerator.startTone(toneId);
        }
    
public voidrelease()

        mToneGenerator.release();
    
public voidstop()

        if (mToneGenerator != null) {
            mToneGenerator.stopTone();
        }