summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Dialer <noreply@google.com>2018-03-30 01:59:03 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-03-30 01:59:03 +0000
commit28a773341687fad5922744a0a8815bebbbc530ae (patch)
tree981a57daee5c8759df841f55361a1147a81015cf
parentedb1255cfc2ccf5e46109d7a192e4444eaf47439 (diff)
parentada4ac8329a8ca4d34dacf51e0c0ac85a637aefb (diff)
Merge "Mark spam voicemail as old after we auto block it." am: d3d4066fff
am: ada4ac8329 Change-Id: I2724d76e63b07b00a1b6b0650b6225a34ac857ba
-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(