diff options
author | John Spurlock <jspurlock@google.com> | 2015-06-10 17:46:58 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-06-11 10:06:30 -0400 |
commit | f82154de8c5274d41c6ae1cbd0170f9e20462a45 (patch) | |
tree | ccb5eb7c4aef33a44fafbfeea419bd740d178037 /src/com/android/settings/notification | |
parent | 8da8e528748fccf4b2291536592648a8e99a36d6 (diff) | |
download | packages_apps_Settings-f82154de8c5274d41c6ae1cbd0170f9e20462a45.zip packages_apps_Settings-f82154de8c5274d41c6ae1cbd0170f9e20462a45.tar.gz packages_apps_Settings-f82154de8c5274d41c6ae1cbd0170f9e20462a45.tar.bz2 |
Settings: Follow frameworks change to volume sliders.
Bug: 21267436
Change-Id: I72c6411346429ebf428662d1c6d6d8a7529c0d67
Diffstat (limited to 'src/com/android/settings/notification')
-rw-r--r-- | src/com/android/settings/notification/NotificationSettings.java | 7 | ||||
-rw-r--r-- | src/com/android/settings/notification/VolumeSeekBarPreference.java | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/settings/notification/NotificationSettings.java b/src/com/android/settings/notification/NotificationSettings.java index 00f5497..98f2517 100644 --- a/src/com/android/settings/notification/NotificationSettings.java +++ b/src/com/android/settings/notification/NotificationSettings.java @@ -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; diff --git a/src/com/android/settings/notification/VolumeSeekBarPreference.java b/src/com/android/settings/notification/VolumeSeekBarPreference.java index 409944f..2bbf9ef 100644 --- a/src/com/android/settings/notification/VolumeSeekBarPreference.java +++ b/src/com/android/settings/notification/VolumeSeekBarPreference.java @@ -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()); |