diff options
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/dialer/spam/Spam.java | 22 | ||||
-rw-r--r-- | java/com/android/dialer/spam/SpamStub.java | 17 |
2 files changed, 39 insertions, 0 deletions
diff --git a/java/com/android/dialer/spam/Spam.java b/java/com/android/dialer/spam/Spam.java index 99deb13b2..09b7ce9c6 100644 --- a/java/com/android/dialer/spam/Spam.java +++ b/java/com/android/dialer/spam/Spam.java @@ -16,6 +16,8 @@ package com.android.dialer.spam; +import android.content.Context; +import android.content.Intent; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.android.dialer.DialerPhoneNumber; @@ -33,6 +35,8 @@ public interface Spam { boolean isSpamNotificationEnabled(); + boolean isSpamBlockingAvailable(); + boolean isSpamBlockingEnabled(); boolean isDialogEnabledForSpamNotification(); @@ -180,10 +184,28 @@ public interface Spam { ReportingLocation.Type from, ContactSource.Type contactSourceType); + /** + * Modifies spam blocking setting. + * + * @param enabled Whether to enable or disable the setting. + * @param listener The callback to be invoked after setting change is done. + */ + void modifySpamBlockingSetting(boolean enabled, ModifySettingListener listener); + + /** Returns an intent to start spam blocking setting */ + Intent getSpamBlockingSettingIntent(Context context); + /** Callback to be invoked when data is fetched. */ interface Listener { /** Called when data is fetched. */ void onComplete(boolean isSpam); } + + /** Callback to be invoked when setting change completes. */ + interface ModifySettingListener { + + /** Called when setting change completes. */ + void onComplete(boolean success); + } } diff --git a/java/com/android/dialer/spam/SpamStub.java b/java/com/android/dialer/spam/SpamStub.java index 15d9d7649..39b05fc58 100644 --- a/java/com/android/dialer/spam/SpamStub.java +++ b/java/com/android/dialer/spam/SpamStub.java @@ -16,6 +16,8 @@ package com.android.dialer.spam; +import android.content.Context; +import android.content.Intent; import com.android.dialer.DialerPhoneNumber; import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor; import com.android.dialer.logging.ContactLookupResult; @@ -50,6 +52,11 @@ public class SpamStub implements Spam { } @Override + public boolean isSpamBlockingAvailable() { + return false; + } + + @Override public boolean isSpamBlockingEnabled() { return false; } @@ -161,4 +168,14 @@ public class SpamStub implements Spam { int callType, ReportingLocation.Type from, ContactSource.Type contactSourceType) {} + + @Override + public void modifySpamBlockingSetting(boolean enabled, ModifySettingListener listener) { + listener.onComplete(false); + } + + @Override + public Intent getSpamBlockingSettingIntent(Context context) { + return new Intent(); + } } |