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

Commit 480b2e44 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Use vibrate icon in volume settings when appropriate." into ics-mr0

parents 6fded4ab ca720584
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -116,9 +116,15 @@ public class RingerVolumePreference extends VolumePreference implements OnClickL
            boolean muted = mAudioManager.isStreamMute(streamType);

            if (mCheckBoxes[i] != null) {
                if (streamType == AudioManager.STREAM_RING && muted
                        && mAudioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_RINGER)) {
                    mCheckBoxes[i].setImageResource(
                            com.android.internal.R.drawable.ic_audio_ring_notif_vibrate);
                } else {
                    mCheckBoxes[i].setImageResource(
                            muted ? SEEKBAR_MUTED_RES_ID[i] : SEEKBAR_UNMUTED_RES_ID[i]);
                }
            }
            if (mSeekBars[i] != null) {
                mSeekBars[i].setEnabled(!muted);
                final int volume = muted ? mAudioManager.getLastAudibleStreamVolume(streamType)
@@ -362,7 +368,11 @@ public class RingerVolumePreference extends VolumePreference implements OnClickL
        // Touching any of the mute buttons causes us to get the state from the system and toggle it
        switch(mAudioManager.getRingerMode()) {
            case AudioManager.RINGER_MODE_NORMAL:
                mAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
                mAudioManager.setRingerMode(
                        (Settings.System.getInt(getContext().getContentResolver(),
                                Settings.System.VIBRATE_IN_SILENT, 1) == 1)
                        ? AudioManager.RINGER_MODE_VIBRATE
                        : AudioManager.RINGER_MODE_SILENT);
                break;
            case AudioManager.RINGER_MODE_VIBRATE:
            case AudioManager.RINGER_MODE_SILENT: