diff options
author | Android Dialer <noreply@google.com> | 2018-03-23 21:10:59 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-26 22:22:40 -0700 |
commit | 07d6d00a5cc6c1aeb1befaccc1e832b3d5b398d8 (patch) | |
tree | 91cf3d0fc7f850ae7fcb334532ba54517e1b5108 /java/com/android/incallui/spam/SpamCallListListener.java | |
parent | 43293286a257c39e173b0dc9a93ff473276eba89 (diff) |
Move spam setting related methods out of spam interface into a separate spam
setting interface.
Test: All the existing tests
PiperOrigin-RevId: 190314880
Change-Id: I030acbd70120f508c5a4616757d89113524110fa
Diffstat (limited to 'java/com/android/incallui/spam/SpamCallListListener.java')
-rw-r--r-- | java/com/android/incallui/spam/SpamCallListListener.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/java/com/android/incallui/spam/SpamCallListListener.java b/java/com/android/incallui/spam/SpamCallListListener.java index 9ef65d877..e852f3d2c 100644 --- a/java/com/android/incallui/spam/SpamCallListListener.java +++ b/java/com/android/incallui/spam/SpamCallListListener.java @@ -205,7 +205,7 @@ public class SpamCallListListener implements CallList.Listener { /** Determines if the after call notification should be shown for the specified call. */ private boolean shouldShowAfterCallNotification(DialerCall call) { - if (!SpamComponent.get(context).spam().isSpamNotificationEnabled()) { + if (!SpamComponent.get(context).spamSettings().isSpamNotificationEnabled()) { return false; } @@ -305,7 +305,8 @@ public class SpamCallListListener implements CallList.Listener { private boolean shouldThrottleSpamNotification() { int randomNumber = random.nextInt(100); - int thresholdForShowing = SpamComponent.get(context).spam().percentOfSpamNotificationsToShow(); + int thresholdForShowing = + SpamComponent.get(context).spamSettings().percentOfSpamNotificationsToShow(); if (thresholdForShowing == 0) { LogUtil.d( "SpamCallListListener.shouldThrottleSpamNotification", @@ -329,7 +330,7 @@ public class SpamCallListListener implements CallList.Listener { private boolean shouldThrottleNonSpamNotification() { int randomNumber = random.nextInt(100); int thresholdForShowing = - SpamComponent.get(context).spam().percentOfNonSpamNotificationsToShow(); + SpamComponent.get(context).spamSettings().percentOfNonSpamNotificationsToShow(); if (thresholdForShowing == 0) { LogUtil.d( "SpamCallListListener.shouldThrottleNonSpamNotification", @@ -418,7 +419,7 @@ public class SpamCallListListener implements CallList.Listener { */ private PendingIntent createBlockReportSpamPendingIntent(DialerCall call) { String action = SpamNotificationActivity.ACTION_MARK_NUMBER_AS_SPAM; - return SpamComponent.get(context).spam().isDialogEnabledForSpamNotification() + return SpamComponent.get(context).spamSettings().isDialogEnabledForSpamNotification() ? createActivityPendingIntent(call, action) : createServicePendingIntent(call, action); } @@ -429,7 +430,7 @@ public class SpamCallListListener implements CallList.Listener { */ private PendingIntent createNotSpamPendingIntent(DialerCall call) { String action = SpamNotificationActivity.ACTION_MARK_NUMBER_AS_NOT_SPAM; - return SpamComponent.get(context).spam().isDialogEnabledForSpamNotification() + return SpamComponent.get(context).spamSettings().isDialogEnabledForSpamNotification() ? createActivityPendingIntent(call, action) : createServicePendingIntent(call, action); } |