summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-10-28 18:59:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-28 18:59:11 -0700
commit69e640ee84fc218d6318acaf73a1c1841d7fba6b (patch)
tree3657937f3baf9261fb25a4efd13e0e5f40f9a11c /core
parent2d280f754e32e556407df05d977cfabdfff1c070 (diff)
parentc696a53d1fe4d61373c5dc64dd057d322da90c8f (diff)
downloadframeworks_base-69e640ee84fc218d6318acaf73a1c1841d7fba6b.zip
frameworks_base-69e640ee84fc218d6318acaf73a1c1841d7fba6b.tar.gz
frameworks_base-69e640ee84fc218d6318acaf73a1c1841d7fba6b.tar.bz2
Merge "Bring back the old-style Ring/Vibrate/Silent states when using volume keys." into ics-mr0
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/VolumePanel.java14
-rw-r--r--core/res/res/drawable-hdpi/ic_audio_ring_notif_vibrate.pngbin0 -> 1309 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_audio_ring_notif_vibrate.pngbin0 -> 905 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_audio_ring_notif_vibrate.pngbin0 -> 1840 bytes
4 files changed, 12 insertions, 2 deletions
diff --git a/core/java/android/view/VolumePanel.java b/core/java/android/view/VolumePanel.java
index 83df8a5..b657204 100644
--- a/core/java/android/view/VolumePanel.java
+++ b/core/java/android/view/VolumePanel.java
@@ -352,6 +352,10 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
sc.seekbarView.setProgress(mAudioManager.getLastAudibleStreamVolume(sc.streamType));
final boolean muted = isMuted(sc.streamType);
sc.icon.setImageResource(muted ? sc.iconMuteRes : sc.iconRes);
+ if (sc.streamType == AudioManager.STREAM_RING && muted
+ && mAudioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_RINGER)) {
+ sc.icon.setImageResource(R.drawable.ic_audio_ring_notif_vibrate);
+ }
sc.seekbarView.setEnabled(!muted);
}
@@ -695,8 +699,14 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
expand();
} else if (v.getTag() instanceof StreamControl) {
StreamControl sc = (StreamControl) v.getTag();
- mAudioManager.setRingerMode(mAudioManager.isSilentMode()
- ? AudioManager.RINGER_MODE_NORMAL : AudioManager.RINGER_MODE_SILENT);
+ boolean vibeInSilent = Settings.System.getInt(mContext.getContentResolver(),
+ System.VIBRATE_IN_SILENT, 1) == 1;
+ int newMode = mAudioManager.isSilentMode()
+ ? AudioManager.RINGER_MODE_NORMAL
+ : (vibeInSilent
+ ? AudioManager.RINGER_MODE_VIBRATE
+ : AudioManager.RINGER_MODE_SILENT);
+ mAudioManager.setRingerMode(newMode);
// Expand the dialog if it hasn't been expanded yet.
if (mShowCombinedVolumes && !isExpanded()) expand();
}
diff --git a/core/res/res/drawable-hdpi/ic_audio_ring_notif_vibrate.png b/core/res/res/drawable-hdpi/ic_audio_ring_notif_vibrate.png
new file mode 100644
index 0000000..4199106
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_audio_ring_notif_vibrate.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_audio_ring_notif_vibrate.png b/core/res/res/drawable-mdpi/ic_audio_ring_notif_vibrate.png
new file mode 100644
index 0000000..2d99b76
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_audio_ring_notif_vibrate.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_audio_ring_notif_vibrate.png b/core/res/res/drawable-xhdpi/ic_audio_ring_notif_vibrate.png
new file mode 100644
index 0000000..122c708
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_audio_ring_notif_vibrate.png
Binary files differ