Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a66c5ce0 authored by Android Dialer's avatar Android Dialer Committed by android-build-merger
Browse files

Merge "Show spam blocking promo notification in place of after call...

Merge "Show spam blocking promo notification in place of after call notification instead of canceling it and recreating a new notification."
am: 2e44e1ff

Change-Id: I99bd63a4a0152b6f4431e495a6893b8b874a24c4
parents dc88a290 2e44e1ff
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -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,