diff options
| author | 2018-12-09 19:27:36 +0900 | |
|---|---|---|
| committer | 2018-12-21 15:20:39 +0000 | |
| commit | 2ca1aec1b9a06aa33c3f9bceebded80a6d1102ba (patch) | |
| tree | 8cf2bb492f3432632b05385d7bdfebd1591c8395 | |
| parent | 4e780bd992e641c719edfcc99f45948ef6d9b71a (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
Merged-In: I208797f370ac5a30db5fcc316be956335a418319
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 9 |
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 1284468947c2..a8a532b575dc 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -4799,22 +4799,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; + } } } } |