From c210b65cd2619ef462bd860c7197ddcb1c39c75c Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Mon, 19 Apr 2010 14:29:05 -0400 Subject: [PATCH] Make the silent/vibrate status icon reflect overall device state. (DO NOT MERGE) Previously, this status icon reflected just the incoming call behavior: - gone for audible (with or without vibrate), - wiggling phone for vibrate, - silent (speaker + X) for no audible ring or vibrate. Now that silent mode has changed (see VIBRATE_IN_SILENT), you can easily get into a state where this icon is confusing by setting the incoming call ringer to *never* vibrate but setting the overall device silent state to allow vibration (VIBRATE_IN_SILENT=true). In this case, rocking the volume all the way down would show a wiggling phone (because the device is in vibrate-only mode) but the status bar would show speaker+X (because the incoming call would neither ring nor vibrate). Now these two icons are consistent. This means, however, that if this special condition is set by the user (device vibrates in silent mode, but incoming calls should never vibrate) and the device is in silent mode, the status bar will show a wiggling phone even though incoming calls will not vibrate the device. This puts the ringer on a more even footing with other apps on the device, which may elect not to vibrate even if VIBRATE_IN_SILENT=true overall. Bug: 2598014 Change-Id: Ib942f68738d77ab0d9b9da4fac718ae5957c133c --- services/java/com/android/server/status/StatusBarPolicy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/java/com/android/server/status/StatusBarPolicy.java b/services/java/com/android/server/status/StatusBarPolicy.java index 465ff2e4508fb..82050ecb580e0 100644 --- a/services/java/com/android/server/status/StatusBarPolicy.java +++ b/services/java/com/android/server/status/StatusBarPolicy.java @@ -1176,7 +1176,7 @@ public class StatusBarPolicy { final int ringerMode = audioManager.getRingerMode(); final boolean visible = ringerMode == AudioManager.RINGER_MODE_SILENT || ringerMode == AudioManager.RINGER_MODE_VIBRATE; - final int iconId = audioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_RINGER) + final int iconId = (ringerMode == AudioManager.RINGER_MODE_VIBRATE) ? com.android.internal.R.drawable.stat_sys_ringer_vibrate : com.android.internal.R.drawable.stat_sys_ringer_silent;