Skip to content

Commit 4f017e7

Browse files
Ed HeylAndroid (Google) Code Review
authored andcommitted
Merge "When in vibrate mode, all notifications will vibrate." into jb-mr1.1-dev
2 parents e72e2b7 + 71789e1 commit 4f017e7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

services/java/com/android/server/NotificationManagerService.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,17 @@ public void enqueueNotificationInternal(String pkg, int callingUid, int callingP
10861086
}
10871087

10881088
// vibrate
1089+
// new in 4.2: if there was supposed to be a sound and we're in vibrate mode,
1090+
// we always vibrate, even if no vibration was specified
1091+
final boolean convertSoundToVibration =
1092+
notification.vibrate == null
1093+
&& (useDefaultSound || notification.sound != null)
1094+
&& (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE);
1095+
10891096
final boolean useDefaultVibrate =
1090-
(notification.defaults & Notification.DEFAULT_VIBRATE) != 0;
1097+
(notification.defaults & Notification.DEFAULT_VIBRATE) != 0
1098+
|| convertSoundToVibration;
1099+
10911100
if ((useDefaultVibrate || notification.vibrate != null)
10921101
&& !(audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT)) {
10931102
mVibrateNotification = r;

0 commit comments

Comments
 (0)