summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/spam/SpamCallListListener.java
diff options
context:
space:
mode:
authorAndroid Dialer <noreply@google.com>2018-05-21 13:16:45 -0700
committerCopybara-Service <copybara-piper@google.com>2018-05-21 16:23:27 -0700
commite6f53f470df53a481b6189438d4ac38cf24e3463 (patch)
treed29439ea759578ff685031eb23e04af24caccbf4 /java/com/android/incallui/spam/SpamCallListListener.java
parent599705c26c7632eb222ed244343eeac280287f7f (diff)
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
Diffstat (limited to 'java/com/android/incallui/spam/SpamCallListListener.java')
-rw-r--r--java/com/android/incallui/spam/SpamCallListListener.java24
1 files changed, 19 insertions, 5 deletions
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}.