Code example for AudioManager

Methods: getVibrateSetting

0
                    //Log.w(TAG,"Got ringer on"); 
                    mAudioService.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
                } else { 
                    //Log.w(TAG,"Got ringer off"); 
	            AudioManager mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
                    boolean vibrateSetting = mAudioManager.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER) == AudioManager.VIBRATE_SETTING_ON;
 
 
		    // We probably lowered the volume on the way "down", so 
		    // raise it a notch before muting 
                    mAudioService.adjustStreamVolume(AudioManager.STREAM_RING, AudioManager.ADJUST_RAISE, 0 );
                    mAudioService.setRingerMode(vibrateSetting ? AudioManager.RINGER_MODE_VIBRATE : AudioManager.RINGER_MODE_SILENT);
 
                } 
 
                // Raise UI 
                mVolumePanel.postVolumeChanged(AudioManager.STREAM_RING,AudioManager.FLAG_SHOW_UI | AudioManager.FLAG_VIBRATE);
 
            } catch (RemoteException e) {
            } 
        }