diff options
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 { |