From 2ca4318cc1ee57dda907ba2069bd61d162b1baef Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Thu, 31 Aug 2017 06:57:16 -0700 Subject: Update Dialer source to latest internal Google revision. Previously, Android's Dialer app was developed in an internal Google source control system and only exported to public during AOSP drops. The Dialer team is now switching to a public development model similar to the telephony team. This CL represents all internal Google changes that were committed to Dialer between the public O release and today's tip of tree on internal master. This CL squashes those changes into a single commit. In subsequent changes, changes will be exported on a per-commit basis. Test: make, flash install, run Merged-In: I45270eaa8ce732d71a1bd84b08c7fa0e99af3160 Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8 PiperOrigin-RevId: 167068436 --- .../android/incallui/spam/SpamNotificationActivity.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'java/com/android/incallui/spam/SpamNotificationActivity.java') diff --git a/java/com/android/incallui/spam/SpamNotificationActivity.java b/java/com/android/incallui/spam/SpamNotificationActivity.java index ece0e4931..86988ad23 100644 --- a/java/com/android/incallui/spam/SpamNotificationActivity.java +++ b/java/com/android/incallui/spam/SpamNotificationActivity.java @@ -18,7 +18,6 @@ package com.android.incallui.spam; import android.app.AlertDialog; import android.app.Dialog; -import android.app.NotificationManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -38,8 +37,8 @@ import com.android.dialer.logging.ContactLookupResult; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.logging.ReportingLocation; +import com.android.dialer.notification.DialerNotificationManager; import com.android.dialer.spam.Spam; -import com.android.incallui.R; import com.android.incallui.call.DialerCall; /** Creates the after call notification dialogs. */ @@ -57,6 +56,7 @@ public class SpamNotificationActivity extends FragmentActivity { "com.android.incallui.spam.ACTION_MARK_NUMBER_AS_NOT_SPAM"; private static final String TAG = "SpamNotifications"; + private static final String EXTRA_NOTIFICATION_TAG = "notification_tag"; private static final String EXTRA_NOTIFICATION_ID = "notification_id"; private static final String EXTRA_CALL_INFO = "call_info"; @@ -82,12 +82,13 @@ public class SpamNotificationActivity extends FragmentActivity { * @return Intent intent that starts this activity. */ public static Intent createActivityIntent( - Context context, DialerCall call, String action, int notificationId) { + Context context, DialerCall call, String action, String notificationTag, int notificationId) { Intent intent = new Intent(context, SpamNotificationActivity.class); intent.setAction(action); // This ensures only one activity of this kind exists at a time. intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtra(EXTRA_NOTIFICATION_TAG, notificationTag); intent.putExtra(EXTRA_NOTIFICATION_ID, notificationId); intent.putExtra(EXTRA_CALL_INFO, newCallInfoBundle(call)); return intent; @@ -294,10 +295,9 @@ public class SpamNotificationActivity extends FragmentActivity { /** Cancels the notification associated with the number. */ private void cancelNotification() { + String notificationTag = getIntent().getStringExtra(EXTRA_NOTIFICATION_TAG); int notificationId = getIntent().getIntExtra(EXTRA_NOTIFICATION_ID, 1); - String number = getCallInfo().getString(CALL_INFO_KEY_PHONE_NUMBER); - ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)) - .cancel(number, notificationId); + DialerNotificationManager.cancel(this, notificationTag, notificationId); } private String getCountryIso() { @@ -373,7 +373,7 @@ public class SpamNotificationActivity extends FragmentActivity { .setTitle(getString(R.string.spam_notification_title, getFormattedNumber(number))) .setMessage(getString(R.string.spam_notification_spam_call_expanded_text)) .setNeutralButton( - getString(R.string.notification_action_dismiss), + getString(R.string.spam_notification_action_dismiss), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -459,7 +459,7 @@ public class SpamNotificationActivity extends FragmentActivity { .setCancelable(false) .setMessage(getString(R.string.spam_notification_non_spam_call_expanded_text)) .setNeutralButton( - getString(R.string.notification_action_dismiss), + getString(R.string.spam_notification_action_dismiss), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { -- cgit v1.2.3