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

Commit 0bfaacba authored by Thomas Stuart's avatar Thomas Stuart
Browse files

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
parent 32acd6d8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -246,3 +246,14 @@ flag {
    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
    }
}
+7 −4
Original line number Diff line number Diff line
@@ -714,14 +714,17 @@ public class CarrierServiceStateTracker extends Handler {
         * 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();
        }
    }