From 4bd39ec1d5644a0c84bc9272cd6e637664862a09 Mon Sep 17 00:00:00 2001 From: maxwelb Date: Fri, 4 May 2018 14:29:39 -0700 Subject: Add ListenableFuture based APIs for checkSpamStatus Bug: 79171382 Test: Tap, manually verified incoming spam call PiperOrigin-RevId: 195472160 Change-Id: I0cda8f36b350a9fc03e098667e8bd83ad8b1d161 --- java/com/android/dialer/spam/Spam.java | 37 +++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'java/com/android/dialer/spam/Spam.java') diff --git a/java/com/android/dialer/spam/Spam.java b/java/com/android/dialer/spam/Spam.java index 21d770ed3..9d0f2a796 100644 --- a/java/com/android/dialer/spam/Spam.java +++ b/java/com/android/dialer/spam/Spam.java @@ -40,6 +40,34 @@ public interface Spam { ListenableFuture> batchCheckSpamStatus( ImmutableSet dialerPhoneNumbers); + /** + * Checks if the given number is suspected of being spam. + * + * @param dialerPhoneNumber the phone number. + * @return the {@link SpamStatus} for the given number. + */ + ListenableFuture checkSpamStatus(DialerPhoneNumber dialerPhoneNumber); + + /** + * Checks if the given number is suspected of being spam. + * + *

See {@link #checkSpamStatus(DialerPhoneNumber)}. + * + * @param number the phone number. + * @param defaultCountryIso the default country to use if it's not part of the number. + * @return the {@link SpamStatus} for the given number. + */ + ListenableFuture checkSpamStatus(String number, @Nullable String defaultCountryIso); + + /** + * Checks if the given number is suspected of being a spam. + * + * @param number The phone number of the call. + * @param countryIso The country ISO of the call. + * @param listener The callback to be invoked after {@code Info} is fetched. + */ + void checkSpamStatus(String number, String countryIso, Listener listener); + /** * Called as an indication that the Spam implementation should check whether downloading a spam * list needs to occur or not. @@ -54,15 +82,6 @@ public interface Spam { */ ListenableFuture updateSpamListDownload(boolean isEnabledByUser); - /** - * Checks if the given number is suspected of being a spam. - * - * @param number The phone number of the call. - * @param countryIso The country ISO of the call. - * @param listener The callback to be invoked after {@code Info} is fetched. - */ - void checkSpamStatus(String number, String countryIso, Listener listener); - /** * @param number The number to check if the number is in the user's white list (non spam list) * @param countryIso The country ISO of the call. -- cgit v1.2.3 From dcff9e63f54d995ab706f63b8b563b077007741c Mon Sep 17 00:00:00 2001 From: maxwelb Date: Fri, 4 May 2018 15:54:56 -0700 Subject: Delete obsolete checkSpamStatus(Listener) API Bug: 79171382 Test: Build PiperOrigin-RevId: 195485088 Change-Id: I306c1ab0fdd629baf1feb0a689debe72eb08b450 --- java/com/android/dialer/spam/Spam.java | 9 --------- 1 file changed, 9 deletions(-) (limited to 'java/com/android/dialer/spam/Spam.java') diff --git a/java/com/android/dialer/spam/Spam.java b/java/com/android/dialer/spam/Spam.java index 9d0f2a796..6aa69af4a 100644 --- a/java/com/android/dialer/spam/Spam.java +++ b/java/com/android/dialer/spam/Spam.java @@ -59,15 +59,6 @@ public interface Spam { */ ListenableFuture checkSpamStatus(String number, @Nullable String defaultCountryIso); - /** - * Checks if the given number is suspected of being a spam. - * - * @param number The phone number of the call. - * @param countryIso The country ISO of the call. - * @param listener The callback to be invoked after {@code Info} is fetched. - */ - void checkSpamStatus(String number, String countryIso, Listener listener); - /** * Called as an indication that the Spam implementation should check whether downloading a spam * list needs to occur or not. -- cgit v1.2.3 From 80e3892b5bc6c6f5294f9bf0bd2aada06677de1d Mon Sep 17 00:00:00 2001 From: maxwelb Date: Fri, 4 May 2018 17:32:56 -0700 Subject: Move SpamStatus classes into subpackage Test: Build PiperOrigin-RevId: 195498557 Change-Id: I28525d0475f847b2ff5a128580256e2688ed47d5 --- java/com/android/dialer/spam/Spam.java | 1 + 1 file changed, 1 insertion(+) (limited to 'java/com/android/dialer/spam/Spam.java') diff --git a/java/com/android/dialer/spam/Spam.java b/java/com/android/dialer/spam/Spam.java index 6aa69af4a..181a55dea 100644 --- a/java/com/android/dialer/spam/Spam.java +++ b/java/com/android/dialer/spam/Spam.java @@ -24,6 +24,7 @@ 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.android.dialer.spam.status.SpamStatus; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.ListenableFuture; -- cgit v1.2.3