summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-01-31 18:00:25 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-31 20:30:00 -0800
commit435347b33b0ea33a535e4bd0836cce52b24abecf (patch)
treef356b6d065c33418b9cb2d4767bb7fc9594cf232 /java
parentf1c6988bddc52f9b37b2359d1668faf8681953b0 (diff)
Add a BatchSpamChecker for InAppSpam.
Bug: 72443587 Test: BatchSpamCheckerTest, SpamDatabaseUtilsTest PiperOrigin-RevId: 184076803 Change-Id: Ib11ca44190a28e28843ef4674c0abebc4203c46a
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/spam/Spam.java6
-rw-r--r--java/com/android/dialer/spam/SpamStub.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/java/com/android/dialer/spam/Spam.java b/java/com/android/dialer/spam/Spam.java
index ea1ea138e..a79205bc0 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.DialerPhoneNumber;
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 @@ public interface Spam {
/**
* 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 ac2e94359..91a56e868 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.common.concurrent.Annotations.BackgroundExecutor;
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 @@ public class SpamStub implements Spam {
@Override
public ListenableFuture<ImmutableMap<DialerPhoneNumber, Boolean>> batchCheckSpamStatus(
- ImmutableList<DialerPhoneNumber> dialerPhoneNumbers) {
+ ImmutableSet<DialerPhoneNumber> dialerPhoneNumbers) {
return backgroundExecutorService.submit(
() -> {
ImmutableMap.Builder<DialerPhoneNumber, Boolean> resultBuilder =