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

Commit fca81cd2 authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Settings: Follow frameworks change to volume sliders." into mnc-dev

parents 1fdbbffc f82154de
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -198,11 +198,16 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
    private void updateRingOrNotificationPreference() {
        mRingOrNotificationPreference.showIcon(mSuppressor != null
                ? com.android.internal.R.drawable.ic_audio_ring_notif_mute
                : mRingerMode == AudioManager.RINGER_MODE_VIBRATE
                : mRingerMode == AudioManager.RINGER_MODE_VIBRATE || wasRingerModeVibrate()
                ? com.android.internal.R.drawable.ic_audio_ring_notif_vibrate
                : com.android.internal.R.drawable.ic_audio_ring_notif);
    }

    private boolean wasRingerModeVibrate() {
        return mVibrator != null && mRingerMode == AudioManager.RINGER_MODE_SILENT
                && mAudioManager.getLastAudibleStreamVolume(AudioManager.STREAM_RING) == 0;
    }

    private void updateRingerMode() {
        final int ringerMode = mAudioManager.getRingerModeInternal();
        if (mRingerMode == ringerMode) return;
+5 −3
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public class VolumeSeekBarPreference extends SeekBarPreference
    private TextView mSuppressionTextView;
    private String mSuppressionText;
    private boolean mMuted;
    private boolean mZenMuted;
    private int mIconResId;
    private int mMuteIconResId;
    private boolean mStopped;
@@ -122,9 +123,10 @@ public class VolumeSeekBarPreference extends SeekBarPreference
                }
            }
            @Override
            public void onMuted(boolean muted) {
                if (mMuted == muted) return;
            public void onMuted(boolean muted, boolean zenMuted) {
                if (mMuted == muted && mZenMuted == zenMuted) return;
                mMuted = muted;
                mZenMuted = zenMuted;
                updateIconView();
            }
        };
@@ -150,7 +152,7 @@ public class VolumeSeekBarPreference extends SeekBarPreference
        if (mIconView == null) return;
        if (mIconResId != 0) {
            mIconView.setImageResource(mIconResId);
        } else if (mMuteIconResId != 0 && mMuted) {
        } else if (mMuteIconResId != 0 && mMuted && !mZenMuted) {
            mIconView.setImageResource(mMuteIconResId);
        } else {
            mIconView.setImageDrawable(getIcon());