diff options
author | Danny Baumann <dannybaumann@web.de> | 2017-02-28 09:16:24 +0100 |
---|---|---|
committer | Dan Pasanen <dan.pasanen@gmail.com> | 2017-03-08 13:53:13 +0000 |
commit | fc1125dcf7f585161ec16a385d5229d1efa0e53d (patch) | |
tree | b3b0a39650d93f38008913eaa42298c5dcddc9d4 | |
parent | e009b45a8ae75019f0876f259cc83e94d31b1376 (diff) | |
download | android_packages_apps_UnifiedEmail-fc1125dcf7f585161ec16a385d5229d1efa0e53d.tar.gz android_packages_apps_UnifiedEmail-fc1125dcf7f585161ec16a385d5229d1efa0e53d.tar.bz2 android_packages_apps_UnifiedEmail-fc1125dcf7f585161ec16a385d5229d1efa0e53d.zip |
Fix cut off notification sounds.
When posting a notification without sound, NotificationManagerService
now stops playing the sound of the previous notification. As we post an
update to the notification ~2s after we originally posted it, this leads
to cut off notification sounds.
Solution: If we only posted an update and didn't notify of new messages,
keep the sound URI set and instruct the notification manager to play the
sound only once.
JIRA: BUGBASH-199
Change-Id: I3aefa62ce1583839ef991380b2be6c39864509a1
-rw-r--r-- | src/com/android/mail/utils/NotificationUtils.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/mail/utils/NotificationUtils.java b/src/com/android/mail/utils/NotificationUtils.java index 966183ed7..ac8ddbe94 100644 --- a/src/com/android/mail/utils/NotificationUtils.java +++ b/src/com/android/mail/utils/NotificationUtils.java @@ -773,8 +773,10 @@ public class NotificationUtils { * We do not want to notify if this is coming back from an Undo notification, hence the * oldWhen check. */ - if (getAttention && oldWhen == 0 && hasNewConversationNotification) { - if (vibrate) { + if (getAttention && oldWhen == 0) { + if (!hasNewConversationNotification) { + notification.setOnlyAlertOnce(true); + } else if (vibrate) { defaults |= Notification.DEFAULT_VIBRATE; } |