summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDavid Agnew <dsandler@android.com>2012-11-09 23:03:26 -0500
committerDaniel Sandler <dsandler@android.com>2012-11-10 14:35:02 -0500
commit4c0fc03b5ed396d19035ee6a77a70189a0fba31a (patch)
tree6f98e958ec3ebe64a3360e550d636deb18714cb7 /services
parent85abb087b9ffd05ff8ecc25575018f4a3fcb966d (diff)
downloadframeworks_base-4c0fc03b5ed396d19035ee6a77a70189a0fba31a.zip
frameworks_base-4c0fc03b5ed396d19035ee6a77a70189a0fba31a.tar.gz
frameworks_base-4c0fc03b5ed396d19035ee6a77a70189a0fba31a.tar.bz2
When in vibrate mode, all notifications will vibrate.
(Unless the notification specifies no ringtone AND no vibration, in which case it will remain silent.) Bug: 7516358 Change-Id: I926d0fe0165b9622cd117e6c3ef6e3637772b444
Diffstat (limited to 'services')
-rwxr-xr-xservices/java/com/android/server/NotificationManagerService.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index 216323e..f3a38f0 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -1086,8 +1086,17 @@ public class NotificationManagerService extends INotificationManager.Stub
}
// vibrate
+ // new in 4.2: if there was supposed to be a sound and we're in vibrate mode,
+ // we always vibrate, even if no vibration was specified
+ final boolean convertSoundToVibration =
+ notification.vibrate == null
+ && (useDefaultSound || notification.sound != null)
+ && (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE);
+
final boolean useDefaultVibrate =
- (notification.defaults & Notification.DEFAULT_VIBRATE) != 0;
+ (notification.defaults & Notification.DEFAULT_VIBRATE) != 0
+ || convertSoundToVibration;
+
if ((useDefaultVibrate || notification.vibrate != null)
&& !(audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT)) {
mVibrateNotification = r;