summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/com/android/dialer/app/calllog/CallLogNotificationsService.java4
-rw-r--r--java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java4
-rw-r--r--java/com/android/dialer/app/calllog/VoicemailQueryHandler.java6
3 files changed, 9 insertions, 5 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogNotificationsService.java b/java/com/android/dialer/app/calllog/CallLogNotificationsService.java
index 10e30ff72..d84bd425b 100644
--- a/java/com/android/dialer/app/calllog/CallLogNotificationsService.java
+++ b/java/com/android/dialer/app/calllog/CallLogNotificationsService.java
@@ -150,12 +150,12 @@ public class CallLogNotificationsService extends IntentService {
LogUtil.i("CallLogNotificationsService.onHandleIntent", "action: " + action);
switch (action) {
case ACTION_MARK_ALL_NEW_VOICEMAILS_AS_OLD:
- VoicemailQueryHandler.markAllNewVoicemailsAsRead(this);
+ VoicemailQueryHandler.markAllNewVoicemailsAsOld(this);
VisualVoicemailNotifier.cancelAllVoicemailNotifications(this);
break;
case ACTION_MARK_SINGLE_NEW_VOICEMAIL_AS_OLD:
Uri voicemailUri = intent.getData();
- VoicemailQueryHandler.markSingleNewVoicemailAsRead(this, voicemailUri);
+ VoicemailQueryHandler.markSingleNewVoicemailAsOld(this, voicemailUri);
VisualVoicemailNotifier.cancelSingleVoicemailNotification(this, voicemailUri);
break;
case ACTION_LEGACY_VOICEMAIL_DISMISSED:
diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java b/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java
index b353b3abc..bae30fa7b 100644
--- a/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java
+++ b/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java
@@ -212,6 +212,10 @@ class VisualVoicemailUpdateTask implements Worker<VisualVoicemailUpdateTask.Inpu
"found voicemail from spam number, suppressing notification");
Logger.get(context)
.logImpression(DialerImpression.Type.INCOMING_VOICEMAIL_AUTO_BLOCKED_AS_SPAM);
+ if (newCall.voicemailUri != null) {
+ // Mark auto blocked voicemail as old so that we don't process it again.
+ VoicemailQueryHandler.markSingleNewVoicemailAsOld(context, newCall.voicemailUri);
+ }
} else {
result.add(newCall);
}
diff --git a/java/com/android/dialer/app/calllog/VoicemailQueryHandler.java b/java/com/android/dialer/app/calllog/VoicemailQueryHandler.java
index 169d0fd35..5d8144ca9 100644
--- a/java/com/android/dialer/app/calllog/VoicemailQueryHandler.java
+++ b/java/com/android/dialer/app/calllog/VoicemailQueryHandler.java
@@ -42,7 +42,7 @@ public class VoicemailQueryHandler extends AsyncQueryHandler {
}
@WorkerThread
- public static void markAllNewVoicemailsAsRead(final @NonNull Context context) {
+ public static void markAllNewVoicemailsAsOld(final @NonNull Context context) {
ThreadUtil.postOnUiThread(
() -> {
new VoicemailQueryHandler(context.getContentResolver())
@@ -51,10 +51,10 @@ public class VoicemailQueryHandler extends AsyncQueryHandler {
}
@WorkerThread
- public static void markSingleNewVoicemailAsRead(
+ public static void markSingleNewVoicemailAsOld(
final @NonNull Context context, final Uri voicemailUri) {
if (voicemailUri == null) {
- LogUtil.e("VoicemailQueryHandler.markSingleNewVoicemailAsRead", "voicemail URI is null");
+ LogUtil.e("VoicemailQueryHandler.markSingleNewVoicemailAsOld", "voicemail URI is null");
return;
}
ThreadUtil.postOnUiThread(