Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db9b4bcd authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

policy: Fix vibrate setting in ringer toggle

The older getVibrateSetting() doesn't work anymore, use the
JB-introduced VIBRATE_WHEN_RINGING setting to figure out if the
user wants vibration or full silence.

Change-Id: I23f0282e797ec341583ad09d0b0f741bf4c2456c
parent d0432402
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -882,8 +882,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            final VolumePanel volumePanel = new VolumePanel(ThemeUtils.createUiContext(mContext),
                                                              (AudioService) getAudioService());
            if (ringerMode == AudioManager.RINGER_MODE_NORMAL) {
                boolean vibrateSetting = am.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER)
                                           == AudioManager.VIBRATE_SETTING_ON;
                boolean vibrateSetting = Settings.System.getInt(mContext.getContentResolver(),
                                           Settings.System.VIBRATE_WHEN_RINGING, 0) != 0;
                am.setRingerMode(vibrateSetting ? AudioManager.RINGER_MODE_VIBRATE :
                                   AudioManager.RINGER_MODE_SILENT);
            } else {