summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Dialer <noreply@google.com>2018-03-30 01:43:12 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-03-30 01:43:12 +0000
commitada4ac8329a8ca4d34dacf51e0c0ac85a637aefb (patch)
tree0671af080bacb036ac8dc2813fb25dd472851f50
parentf44768c9898eb25429f3f973ae7e0f61615b7e11 (diff)
parentd3d4066fff2aa9a7c1ace76b193a06a9ce7e5c2d (diff)
Merge "Mark spam voicemail as old after we auto block it."
am: d3d4066fff Change-Id: I0ba30c68f770a4fe320f347fb9f55b01b53ba91f
-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(