summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/provider/Settings.java11
-rw-r--r--core/res/res/drawable-hdpi/ic_jog_dial_vibrate_on.pngbin0 -> 8351 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_jog_dial_vibrate_on.pngbin0 -> 4814 bytes
-rw-r--r--media/java/android/media/AudioService.java20
4 files changed, 22 insertions, 9 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 081cf32..18e2647 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1279,6 +1279,17 @@ public final class Settings {
"notifications_use_ring_volume";
/**
+ * Whether silent mode should allow vibration feedback. This is used
+ * internally in AudioService and the Sound settings activity to
+ * coordinate decoupling of vibrate and silent modes. This setting
+ * will likely be removed in a future release with support for
+ * audio/vibe feedback profiles.
+ *
+ * @hide
+ */
+ public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
+
+ /**
* The mapping of stream type (integer) to its setting.
*/
public static final String[] VOLUME_SETTINGS = {
diff --git a/core/res/res/drawable-hdpi/ic_jog_dial_vibrate_on.png b/core/res/res/drawable-hdpi/ic_jog_dial_vibrate_on.png
new file mode 100644
index 0000000..86caa07
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_jog_dial_vibrate_on.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_jog_dial_vibrate_on.png b/core/res/res/drawable-mdpi/ic_jog_dial_vibrate_on.png
new file mode 100644
index 0000000..9aa9b13
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_jog_dial_vibrate_on.png
Binary files differ
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 668917e..947307d 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -901,18 +901,20 @@ public class AudioService extends IAudioService.Stub {
boolean adjustVolumeIndex = true;
int newRingerMode = mRingerMode;
- if (mRingerMode == AudioManager.RINGER_MODE_NORMAL && (oldIndex + 5) / 10 == 1
- && direction == AudioManager.ADJUST_LOWER) {
- newRingerMode = AudioManager.RINGER_MODE_VIBRATE;
- } else if (mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
+ if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
+ // audible mode, at the bottom of the scale
+ if (direction == AudioManager.ADJUST_LOWER
+ && (oldIndex + 5) / 10 == 1) {
+ // "silent mode", but which one?
+ newRingerMode = System.getInt(mContentResolver, System.VIBRATE_IN_SILENT, 1) == 1
+ ? AudioManager.RINGER_MODE_VIBRATE
+ : AudioManager.RINGER_MODE_SILENT;
+ }
+ } else {
if (direction == AudioManager.ADJUST_RAISE) {
+ // exiting silent mode
newRingerMode = AudioManager.RINGER_MODE_NORMAL;
- } else if (direction == AudioManager.ADJUST_LOWER) {
- newRingerMode = AudioManager.RINGER_MODE_SILENT;
}
- } else if (direction == AudioManager.ADJUST_RAISE
- && mRingerMode == AudioManager.RINGER_MODE_SILENT) {
- newRingerMode = AudioManager.RINGER_MODE_VIBRATE;
}
if (newRingerMode != mRingerMode) {