summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Seungho Lee <shiny.lee@samsung.com> 2018-12-09 19:27:36 +0900
committer Julia Reynolds <juliacr@google.com> 2018-12-21 10:14:38 -0500
commit55102a8ebd31cdab3563b5da3aeac1936ddce56c (patch)
tree0873e8b079fc27cf708a9479486e39bfc2def884
parent90a78ef003e4ba7c6c201ebf4f989a9443f0b824 (diff)
Update sound/vibrate notification key only when it actually buzz/beep.
Test: Make notification with vibration pattern with [0] Test: Check mVibrateNotificationKey unchanged Change-Id: I208797f370ac5a30db5fcc316be956335a418319
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index d961bad1cf59..8bd6e547a73c 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -5258,22 +5258,25 @@ public class NotificationManagerService extends SystemService {
}
if (DBG) Slog.v(TAG, "Interrupting!");
if (hasValidSound) {
- mSoundNotificationKey = key;
if (mInCall) {
playInCallNotification();
beep = true;
} else {
beep = playSound(record, soundUri);
}
+ if(beep) {
+ mSoundNotificationKey = key;
+ }
}
final boolean ringerModeSilent =
mAudioManager.getRingerModeInternal()
== AudioManager.RINGER_MODE_SILENT;
if (!mInCall && hasValidVibrate && !ringerModeSilent) {
- mVibrateNotificationKey = key;
-
buzz = playVibration(record, vibration, hasValidSound);
+ if(buzz) {
+ mVibrateNotificationKey = key;
+ }
}
} else if ((record.getFlags() & Notification.FLAG_INSISTENT) != 0) {
hasValidSound = false;