Skip to content

Commit

Permalink
When in vibrate mode, all notifications will vibrate.
Browse files Browse the repository at this point in the history
(Unless the notification specifies no ringtone AND no
vibration, in which case it will remain silent.)

Change-Id: I926d0fe0165b9622cd117e6c3ef6e3637772b444
  • Loading branch information
dsandler authored and The Android Automerger committed Nov 10, 2012
1 parent 5624af2 commit 9a7debe
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion services/java/com/android/server/NotificationManagerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,17 @@ public void enqueueNotificationInternal(String pkg, int callingUid, int callingP
}

// 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;
Expand Down

0 comments on commit 9a7debe

Please sign in to comment.