diff options
author | mdooley <mdooley@google.com> | 2017-09-20 00:29:39 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-09-20 00:29:39 +0000 |
commit | b04b271c5aad2572c93064d904b829195180f7bd (patch) | |
tree | 4f96744266a74a4d0787b35b8bdb47819fdd5dd6 | |
parent | 495bc572a678b8873bb86d4dafdd4c5febe36fc9 (diff) | |
parent | aa47240e862179817c4c2135b844516bcfa957c9 (diff) |
Merge "Fix notification update bug"
am: aa47240e86
Change-Id: I262298d3748f78aed1a7411b859dbb030f707f37
3 files changed, 12 insertions, 3 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogNotificationsQueryHelper.java b/java/com/android/dialer/app/calllog/CallLogNotificationsQueryHelper.java index 2f8b1f476..f962e17ac 100644 --- a/java/com/android/dialer/app/calllog/CallLogNotificationsQueryHelper.java +++ b/java/com/android/dialer/app/calllog/CallLogNotificationsQueryHelper.java @@ -363,7 +363,14 @@ public class CallLogNotificationsQueryHelper { "No READ_CALL_LOG permission, returning null for calls lookup."); return null; } - try (Cursor cursor = mContentResolver.query(callsUri, PROJECTION, null, null, null)) { + final String selection = String.format("%s = '%s'", Calls.VOICEMAIL_URI, callsUri.toString()); + try (Cursor cursor = + mContentResolver.query( + Calls.CONTENT_URI_WITH_VOICEMAIL, + (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) ? PROJECTION_O : PROJECTION, + selection, + null, + null)) { if (cursor == null) { return null; } diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java b/java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java index ceae3d38e..1836416a7 100644 --- a/java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java +++ b/java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java @@ -52,7 +52,7 @@ import java.util.Map; /** Shows a notification in the status bar for visual voicemail. */ final class VisualVoicemailNotifier { /** Prefix used to generate a unique tag for each voicemail notification. */ - private static final String NOTIFICATION_TAG_PREFIX = "VisualVoicemail_"; + static final String NOTIFICATION_TAG_PREFIX = "VisualVoicemail_"; /** Common ID for all voicemail notifications. */ static final int NOTIFICATION_ID = 1; /** Tag for the group summary notification. */ diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java b/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java index 219ad676d..abbb60679 100644 --- a/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java +++ b/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java @@ -126,7 +126,9 @@ class VisualVoicemailUpdateTask implements Worker<VisualVoicemailUpdateTask.Inpu // Group header continue; } - NewCall existingCall = queryHelper.getNewCallsQuery().query(Uri.parse(notification.getTag())); + String uri = + notification.getTag().replace(VisualVoicemailNotifier.NOTIFICATION_TAG_PREFIX, ""); + NewCall existingCall = queryHelper.getNewCallsQuery().query(Uri.parse(uri)); if (existingCall != null) { result.add(existingCall); } else { |