From e6f53f470df53a481b6189438d4ac38cf24e3463 Mon Sep 17 00:00:00 2001 From: Android Dialer Date: Mon, 21 May 2018 13:16:45 -0700 Subject: Adds alternative spam words for non-english speaking countries. This CL adds alternative spam words and code for using these words in an experiment. Test: Tap, Unit tests where alterntive experiment is provided and not provided. PiperOrigin-RevId: 197444892 Change-Id: Iff042966f1728ac571699085f07d1325e756dd36 --- .../incallui/spam/SpamCallListListener.java | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'java/com/android/incallui/spam/SpamCallListListener.java') diff --git a/java/com/android/incallui/spam/SpamCallListListener.java b/java/com/android/incallui/spam/SpamCallListListener.java index 350dd60fc..d03055568 100644 --- a/java/com/android/incallui/spam/SpamCallListListener.java +++ b/java/com/android/incallui/spam/SpamCallListListener.java @@ -277,11 +277,15 @@ public class SpamCallListListener implements CallList.Listener { Notification.Builder notificationBuilder = createAfterCallNotificationBuilder(call) .setContentText( - context.getString(R.string.spam_notification_non_spam_call_collapsed_text)) + context.getString( + SpamAlternativeExperimentUtil.getResourceIdByName( + "spam_notification_non_spam_call_collapsed_text", context))) .setStyle( new Notification.BigTextStyle() .bigText( - context.getString(R.string.spam_notification_non_spam_call_expanded_text))) + context.getString( + SpamAlternativeExperimentUtil.getResourceIdByName( + "spam_notification_non_spam_call_expanded_text", context)))) // Add contact .addAction( new Notification.Action.Builder( @@ -392,12 +396,17 @@ public class SpamCallListListener implements CallList.Listener { Notification.Builder notificationBuilder = createAfterCallNotificationBuilder(call) .setLargeIcon(Icon.createWithResource(context, R.drawable.spam_notification_icon)) - .setContentText(context.getString(R.string.spam_notification_spam_call_collapsed_text)) + .setContentText( + context.getString( + SpamAlternativeExperimentUtil.getResourceIdByName( + "spam_notification_spam_call_collapsed_text", context))) // Not spam .addAction( new Notification.Action.Builder( R.drawable.quantum_ic_close_vd_theme_24, - context.getString(R.string.spam_notification_was_not_spam_action_text), + context.getString( + SpamAlternativeExperimentUtil.getResourceIdByName( + "spam_notification_was_not_spam_action_text", context)), createNotSpamPendingIntent(call)) .build()) // Block/report spam @@ -408,11 +417,16 @@ public class SpamCallListListener implements CallList.Listener { createBlockReportSpamPendingIntent(call)) .build()) .setContentTitle( - context.getString(R.string.spam_notification_title, getDisplayNumber(call))); + context.getString( + SpamAlternativeExperimentUtil.getResourceIdByName( + "spam_notification_title", context), + getDisplayNumber(call))); DialerNotificationManager.notify( context, getNotificationTagForCall(call), NOTIFICATION_ID, notificationBuilder.build()); } + + /** * Creates a pending intent for block/report spam action. If enabled, this intent is forwarded to * the {@link SpamNotificationActivity}, otherwise to the {@link SpamNotificationService}. -- cgit v1.2.3