diff options
author | Dheeraj Shetty <dshetty@codeaurora.org> | 2016-01-04 18:24:03 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-05-19 18:32:54 -0700 |
commit | 200efcbcc296c08f3d38f0d5871163f2b4d0d703 (patch) | |
tree | f50bfe95eb2b38db13c575957f9ec04b692cc826 | |
parent | 4bc71aa61dee920c99c40ef4684785434f5b1e99 (diff) | |
download | android_packages_services_Telecomm-200efcbcc296c08f3d38f0d5871163f2b4d0d703.tar.gz android_packages_services_Telecomm-200efcbcc296c08f3d38f0d5871163f2b4d0d703.tar.bz2 android_packages_services_Telecomm-200efcbcc296c08f3d38f0d5871163f2b4d0d703.zip |
IMS: Fix vice notifications
Avoid duplicate vice notification by clearing them individually.
Remove usage of clearAll notifications - async call, does not handle back
to back vice indications/service status updates cleanly.
Change-Id: I764d0c6560c561b8a413dfe1b1a7731088e1604d
CRs-fixed: 949504 952824 953411
-rw-r--r-- | src/com/android/server/telecom/ui/ViceNotificationImpl.java | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/com/android/server/telecom/ui/ViceNotificationImpl.java b/src/com/android/server/telecom/ui/ViceNotificationImpl.java index ac068d29..2d33b86f 100644 --- a/src/com/android/server/telecom/ui/ViceNotificationImpl.java +++ b/src/com/android/server/telecom/ui/ViceNotificationImpl.java @@ -176,11 +176,10 @@ public class ViceNotificationImpl extends CallsManagerListenerBase { // Clear the existing notifications on statusbar and // Hashmap whenever new Vice Notification is received private void resetBeforeProcess() { - mNotificationManager.cancelAll(); - mNotification.clear(); mBuilder = null; mPublicNotificationBuilder = null; mWasInCall = false; + checkAndUpdateNotification(); } /* Service connection bound to IQtiImsInterface */ @@ -323,7 +322,6 @@ public class ViceNotificationImpl extends CallsManagerListenerBase { + ", notifId = " + notifId); resetBuilders(); - checkAndUpdateNotification(callInfo, false); Log.i(this, "processNotification isInCall = " + getTelecomManager().isInCall()); isVt = isVtCall(callInfo[QtiViceInfo.INDEX_CALLTYPE]); @@ -349,7 +347,6 @@ public class ViceNotificationImpl extends CallsManagerListenerBase { } } else { Log.i(this, "processNotification DEP null"); - resetBeforeProcess(); } } @@ -393,12 +390,12 @@ public class ViceNotificationImpl extends CallsManagerListenerBase { } /** - * API updates the hashmap in following order : - * - if new call : create new entry - * - if existing call : cancel existing notification and remove it from hashmap - * It will get added to hashmap in showNotification() + * Retrieve all notifications from the map. + * Cancel and remove all notifications from the map. + * CancelAll not used as it is an asynchronous call and can cause issue with + * back to back notifications. */ - private void checkAndUpdateNotification(String[] callInfo, boolean clear) { + private void checkAndUpdateNotification() { Set<Map.Entry<String, Integer>> call = mNotification.entrySet(); if ((call == null) || (mNotification.isEmpty())) { return; @@ -409,10 +406,8 @@ public class ViceNotificationImpl extends CallsManagerListenerBase { Map.Entry<String, Integer> entry = iterator.next(); String dialog = entry.getKey(); Integer notifId = entry.getValue(); - if (dialog.equalsIgnoreCase(callInfo[QtiViceInfo.INDEX_DIALOG_ID])) { - mNotificationManager.cancel(notifId); - call.remove(dialog); - } + mNotificationManager.cancel(notifId); + iterator.remove(); } } |