mContext = context; updateRingerMode();
if (null == mInstance) { if (null != context) { mInstance = new SoundManager(context); } } return mInstance;
if (mAudioManager == null) { updateRingerMode(); } if (!mSilentMode) { int sound = AudioManager.FX_KEYPRESS_STANDARD; mAudioManager.playSoundEffect(sound, FX_VOLUME); }
if (mAudioManager == null) { mAudioManager = (AudioManager) mContext .getSystemService(Context.AUDIO_SERVICE); } mSilentMode = (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL);