Code example for AudioManager

Methods: getStreamVolumegetVibrateSettingsetStreamVolumesetVibrateSetting

0
        } catch (Settings.SettingNotFoundException e) {
            editer.putInt(OLD_NOTIF_LED, 1);
        } 
 
        editer.putInt(OLD_NOTIFICATION_VOLUME,
            audio_mgr.getStreamVolume(AudioManager.STREAM_NOTIFICATION));
        editer.putInt(OLD_NOTIFICATION_VIBRATE,
            audio_mgr.getVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION));
 
        editer.putInt(OLD_RINGER_VOLUME,
            audio_mgr.getStreamVolume(AudioManager.STREAM_RING));
        editer.putInt(OLD_RINGER_VIBRATE,
            audio_mgr.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER));
 
        editer.commit();
    } 
 
    private void updateSettings() { 
        Log.v(TAG, "seting dock settings");
        Settings.System.putInt(
            context.getContentResolver(),
            "notifications_use_ring_volume", 
            0); 
 
        if (getPref("notification_led")) { 
            Settings.System.putInt(
                context.getContentResolver(),
                "notification_light_pulse", 
                0); 
        } 
 
        if (getPref("notification_sound")) { 
            audio_mgr.setStreamVolume(AudioManager.STREAM_NOTIFICATION, 0, 0);
        } 
        if (getPref("notification_vibrate")) { 
            audio_mgr.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION,
                AudioManager.VIBRATE_SETTING_OFF);
        } 
 
        if (getPref("ringer_sound")) { 
            audio_mgr.setStreamVolume(AudioManager.STREAM_RING, 0, 0);
        } 
        if (getPref("ringer_vibrate")) { 
            audio_mgr.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
                AudioManager.VIBRATE_SETTING_OFF);
        } 
    } 
 
    private void restoreSettings() { 
Stop searching for code, let great code find you!  Add Codota to your java IDE