Make No Emergency Wifi Calling "Do Not Ask Again" text translatable
Reference the newly defined translatable string in frameworks/core.
Previously the string was static and only readable in english. Now,
the text will dynamically change to the correct language of the user.
Flag: com.android.internal.telephony.flags.dynamic_do_not_ask_again_text
Test: manual
Fixes: 382006472
Change-Id: I62b7812fb043a1d4fe201b157b96ce18373f1367
diff --git a/flags/misc.aconfig b/flags/misc.aconfig
index ec7b8fa..4579ae2 100644
--- a/flags/misc.aconfig
+++ b/flags/misc.aconfig
@@ -246,3 +246,14 @@
description: "Disable CDMA and NV backing code"
bug: "379356026"
}
+
+# OWNER=tjstuart TARGET=25Q2
+flag {
+ name: "dynamic_do_not_ask_again_text"
+ namespace: "telephony"
+ description: "Make No Emergency Wifi Calling Do Not Ask Again text translatable"
+ bug:"382006472"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/src/java/com/android/internal/telephony/CarrierServiceStateTracker.java b/src/java/com/android/internal/telephony/CarrierServiceStateTracker.java
index b470e2e..1e73fbb 100644
--- a/src/java/com/android/internal/telephony/CarrierServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/CarrierServiceStateTracker.java
@@ -714,14 +714,17 @@
* add a button to the notification that has a broadcast intent embedded to silence the
* notification
*/
- private Notification.Action createDoNotShowAgainAction(Context context) {
+ private Notification.Action createDoNotShowAgainAction(Context c) {
final PendingIntent pendingIntent = PendingIntent.getBroadcast(
- context,
+ c,
0,
new Intent(ACTION_NEVER_ASK_AGAIN),
PendingIntent.FLAG_IMMUTABLE);
- return new Notification.Action.Builder(null, "Do Not Show Again",
- pendingIntent).build();
+ CharSequence text = "Do Not Ask Again";
+ if (c != null && mFeatureFlags.dynamicDoNotAskAgainText()) {
+ text = c.getText(com.android.internal.R.string.emergency_calling_do_not_show_again);
+ }
+ return new Notification.Action.Builder(null, text, pendingIntent).build();
}
}