summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-01-18 14:56:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-01-18 14:56:48 +0000
commiteec32e2d2d145f2b4e4ba244eced223cd77b0501 (patch)
tree58b01b081318832922b5dd66825c4cedca286e95
parent2ec59897cf892666146f378825d2adcf972248ac (diff)
parent2143e5de733cf239cceb58af24f73385a113759b (diff)
Merge "Don't play notification audio in vibrate mode"
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index f09e856cb21f..901830291976 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -3289,7 +3289,9 @@ public class NotificationManagerService extends SystemService {
private boolean playSound(final NotificationRecord record, Uri soundUri) {
boolean looping = (record.getNotification().flags & Notification.FLAG_INSISTENT) != 0;
// do not play notifications if there is a user of exclusive audio focus
- if (!mAudioManager.isAudioFocusExclusive()) {
+ // or the device is in vibrate mode
+ if (!mAudioManager.isAudioFocusExclusive() && mAudioManager.getRingerModeInternal()
+ != AudioManager.RINGER_MODE_VIBRATE) {
final long identity = Binder.clearCallingIdentity();
try {
final IRingtonePlayer player = mAudioManager.getRingtonePlayer();