diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-05-18 05:20:57 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-05-18 05:20:57 +0000 |
commit | 2e44e1ff56842bcf11e52c42cd3d7da3ca735548 (patch) | |
tree | 615223cdad6b3b744657d8846eec7e7d0cc83960 /java/com/android | |
parent | f3fc4891f1ec8b8eefc4f7a2169114f35aeb33bb (diff) | |
parent | c165ca166dd592ce3e46a027a42bec223d74e6e1 (diff) |
Merge "Show spam blocking promo notification in place of after call notification instead of canceling it and recreating a new notification."
Diffstat (limited to 'java/com/android')
-rw-r--r-- | java/com/android/incallui/spam/SpamNotificationService.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/java/com/android/incallui/spam/SpamNotificationService.java b/java/com/android/incallui/spam/SpamNotificationService.java index 82a943da7..f7deae1a8 100644 --- a/java/com/android/incallui/spam/SpamNotificationService.java +++ b/java/com/android/incallui/spam/SpamNotificationService.java @@ -103,11 +103,18 @@ public class SpamNotificationService extends Service { ContactLookupResult.Type contactLookupResultType = ContactLookupResult.Type.forNumber(intent.getIntExtra(EXTRA_CONTACT_LOOKUP_RESULT_TYPE, 0)); - DialerNotificationManager.cancel(this, notificationTag, notificationId); - SpamSettings spamSettings = SpamComponent.get(this).spamSettings(); SpamBlockingPromoHelper spamBlockingPromoHelper = new SpamBlockingPromoHelper(this, SpamComponent.get(this).spamSettings()); + boolean shouldShowSpamBlockingPromo = + SpamNotificationActivity.ACTION_MARK_NUMBER_AS_SPAM.equals(intent.getAction()) + && spamBlockingPromoHelper.shouldShowAfterCallSpamBlockingPromo(); + + // Cancel notification only if we are not showing spam blocking promo. Otherwise we will show + // spam blocking promo notification in place. + if (!shouldShowSpamBlockingPromo) { + DialerNotificationManager.cancel(this, notificationTag, notificationId); + } switch (intent.getAction()) { case SpamNotificationActivity.ACTION_MARK_NUMBER_AS_SPAM: @@ -122,7 +129,7 @@ public class SpamNotificationService extends Service { ReportingLocation.Type.FEEDBACK_PROMPT, contactLookupResultType); new FilteredNumberAsyncQueryHandler(this).blockNumber(null, number, countryIso); - if (spamBlockingPromoHelper.shouldShowAfterCallSpamBlockingPromo()) { + if (shouldShowSpamBlockingPromo) { spamBlockingPromoHelper.showSpamBlockingPromoNotification( notificationTag, notificationId, |