summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java')
-rw-r--r--java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java27
1 files changed, 12 insertions, 15 deletions
diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java b/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java
index 6d2581f46..4516382c5 100644
--- a/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java
+++ b/java/com/android/dialer/app/calllog/VisualVoicemailUpdateTask.java
@@ -36,7 +36,6 @@ import com.android.dialer.logging.DialerImpression;
import com.android.dialer.logging.Logger;
import com.android.dialer.notification.DialerNotificationManager;
import com.android.dialer.phonenumbercache.ContactInfo;
-import com.android.dialer.spam.Spam;
import com.android.dialer.spam.SpamComponent;
import com.android.dialer.telecom.TelecomUtil;
import java.util.ArrayList;
@@ -48,7 +47,7 @@ class VisualVoicemailUpdateTask implements Worker<VisualVoicemailUpdateTask.Inpu
@Nullable
@Override
public Void doInBackground(@NonNull Input input) throws Throwable {
- updateNotification(input.context, input.queryHelper, input.queryHandler, input.spam);
+ updateNotification(input.context, input.queryHelper, input.queryHandler);
return null;
}
@@ -62,8 +61,7 @@ class VisualVoicemailUpdateTask implements Worker<VisualVoicemailUpdateTask.Inpu
private static void updateNotification(
Context context,
CallLogNotificationsQueryHelper queryHelper,
- FilteredNumberAsyncQueryHandler queryHandler,
- Spam spam) {
+ FilteredNumberAsyncQueryHandler queryHandler) {
Assert.isWorkerThread();
LogUtil.enterBlock("VisualVoicemailUpdateTask.updateNotification");
@@ -79,7 +77,7 @@ class VisualVoicemailUpdateTask implements Worker<VisualVoicemailUpdateTask.Inpu
"not filtering due to recent emergency call");
} else {
voicemailsToNotify = filterBlockedNumbers(context, queryHandler, voicemailsToNotify);
- voicemailsToNotify = filterSpamNumbers(context, spam, voicemailsToNotify);
+ voicemailsToNotify = filterSpamNumbers(context, voicemailsToNotify);
}
boolean shouldAlert =
!voicemailsToNotify.isEmpty()
@@ -197,23 +195,26 @@ class VisualVoicemailUpdateTask implements Worker<VisualVoicemailUpdateTask.Inpu
}
@WorkerThread
- private static List<NewCall> filterSpamNumbers(
- Context context, Spam spam, List<NewCall> newCalls) {
+ private static List<NewCall> filterSpamNumbers(Context context, List<NewCall> newCalls) {
Assert.isWorkerThread();
- if (!spam.isSpamBlockingEnabled()) {
+ if (!SpamComponent.get(context).spamSettings().isSpamBlockingEnabled()) {
+ LogUtil.w("VisualVoicemailUpdateTask.wwwwwwwwwwwww", "NOT ENABLED");
return newCalls;
}
List<NewCall> result = new ArrayList<>();
for (NewCall newCall : newCalls) {
Logger.get(context).logImpression(DialerImpression.Type.INCOMING_VOICEMAIL_SCREENED);
- if (spam.checkSpamStatusSynchronous(newCall.number, newCall.countryIso)) {
+ if (SpamComponent.get(context)
+ .spam()
+ .checkSpamStatusSynchronous(newCall.number, newCall.countryIso)) {
LogUtil.i(
"VisualVoicemailUpdateTask.filterSpamNumbers",
"found voicemail from spam number, suppressing notification");
Logger.get(context)
.logImpression(DialerImpression.Type.INCOMING_VOICEMAIL_AUTO_BLOCKED_AS_SPAM);
} else {
+ LogUtil.w("VisualVoicemailUpdateTask.wwwwwwwwwwwww", "NOT SPAM NUMBER");
result.add(newCall);
}
}
@@ -234,8 +235,7 @@ class VisualVoicemailUpdateTask implements Worker<VisualVoicemailUpdateTask.Inpu
new Input(
context,
CallLogNotificationsQueryHelper.getInstance(context),
- new FilteredNumberAsyncQueryHandler(context),
- SpamComponent.get(context).spam());
+ new FilteredNumberAsyncQueryHandler(context));
DialerExecutorComponent.get(context)
.dialerExecutorFactory()
.createNonUiTaskBuilder(new VisualVoicemailUpdateTask())
@@ -257,17 +257,14 @@ class VisualVoicemailUpdateTask implements Worker<VisualVoicemailUpdateTask.Inpu
@NonNull final Context context;
@NonNull final CallLogNotificationsQueryHelper queryHelper;
@NonNull final FilteredNumberAsyncQueryHandler queryHandler;
- @NonNull final Spam spam;
Input(
Context context,
CallLogNotificationsQueryHelper queryHelper,
- FilteredNumberAsyncQueryHandler queryHandler,
- Spam spam) {
+ FilteredNumberAsyncQueryHandler queryHandler) {
this.context = context;
this.queryHelper = queryHelper;
this.queryHandler = queryHandler;
- this.spam = spam;
}
}
}