Add a BatchSpamChecker for InAppSpam.
Bug: 72443587
Test: BatchSpamCheckerTest, SpamDatabaseUtilsTest
PiperOrigin-RevId: 184076803
Change-Id: Ib11ca44190a28e28843ef4674c0abebc4203c46a
diff --git a/java/com/android/dialer/spam/Spam.java b/java/com/android/dialer/spam/Spam.java
index ea1ea13..a79205b 100644
--- a/java/com/android/dialer/spam/Spam.java
+++ b/java/com/android/dialer/spam/Spam.java
@@ -22,8 +22,8 @@
import com.android.dialer.logging.ContactLookupResult;
import com.android.dialer.logging.ContactSource;
import com.android.dialer.logging.ReportingLocation;
-import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.ListenableFuture;
/** Allows the container application to mark calls as spam. */
@@ -45,12 +45,12 @@
/**
* Checks if each of numbers in the given list is suspected of being a spam.
*
- * @param dialerPhoneNumbers A list of {@link DialerPhoneNumber}.
+ * @param dialerPhoneNumbers A set of {@link DialerPhoneNumber}.
* @return A {@link ListenableFuture} of a map that maps each number to its spam status
* (true/false).
*/
ListenableFuture<ImmutableMap<DialerPhoneNumber, Boolean>> batchCheckSpamStatus(
- ImmutableList<DialerPhoneNumber> dialerPhoneNumbers);
+ ImmutableSet<DialerPhoneNumber> dialerPhoneNumbers);
/**
* Checks if the given number is suspected of being a spam.
diff --git a/java/com/android/dialer/spam/SpamStub.java b/java/com/android/dialer/spam/SpamStub.java
index ac2e943..91a56e8 100644
--- a/java/com/android/dialer/spam/SpamStub.java
+++ b/java/com/android/dialer/spam/SpamStub.java
@@ -21,8 +21,8 @@
import com.android.dialer.logging.ContactLookupResult;
import com.android.dialer.logging.ContactSource;
import com.android.dialer.logging.ReportingLocation;
-import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
@@ -70,7 +70,7 @@
@Override
public ListenableFuture<ImmutableMap<DialerPhoneNumber, Boolean>> batchCheckSpamStatus(
- ImmutableList<DialerPhoneNumber> dialerPhoneNumbers) {
+ ImmutableSet<DialerPhoneNumber> dialerPhoneNumbers) {
return backgroundExecutorService.submit(
() -> {
ImmutableMap.Builder<DialerPhoneNumber, Boolean> resultBuilder =