mToneGenerator = new ToneGenerator(AudioManager.STREAM_SYSTEM, 100);
int toneId = ToneGenerator.TONE_PROP_BEEP; if (tone != null && mToneMap.containsKey(tone)) { toneId = mToneMap.get(tone); } return toneId;
int toneId = getToneId(tone); if (toneId > 0 && mToneGenerator != null) { mToneGenerator.startTone(toneId); }
mToneGenerator.release();
if (mToneGenerator != null) { mToneGenerator.stopTone(); }