summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ed Heyl <edheyl@google.com> 2012-11-09 23:57:05 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2012-11-09 23:57:05 -0800
commit2184f99aabb01fb619fc42b1cfe09e8eb5585af1 (patch)
tree3e2f35761b0f284177a6f47fbabaaa2423c1ad8c
parent6e9801a780bc4f558b1093373c748b06002be86d (diff)
parentffea917025254ab33670b1268588d63514ddf918 (diff)
am ffea9170: am 5ec97f4e: am 4f017e75: Merge "When in vibrate mode, all notifications will vibrate." into jb-mr1.1-dev
* commit 'ffea917025254ab33670b1268588d63514ddf918': When in vibrate mode, all notifications will vibrate.
-rw-r--r--services/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 216323ea6577..f3a38f0c7cdb 100644
--- 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;