summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-05 22:53:07 +0100
committercyBerta <cyberta@riseup.net>2021-11-05 22:53:07 +0100
commit7b9cb67eb7aa3eadf99a5187d2ea79b83ab57380 (patch)
treeea380e54bafd4f53465646c1a75efb3df7ca27d7 /app
parent88b7dc2eb3dcbec8d1e637096867c15211818677 (diff)
localize notification channel description for tor notifications
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tor/TorNotificationManager.java9
-rw-r--r--app/src/main/res/values/strings.xml2
2 files changed, 7 insertions, 4 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/tor/TorNotificationManager.java b/app/src/main/java/se/leap/bitmaskclient/tor/TorNotificationManager.java
index 45570857..c8bc0e2d 100644
--- a/app/src/main/java/se/leap/bitmaskclient/tor/TorNotificationManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/tor/TorNotificationManager.java
@@ -75,15 +75,16 @@ public class TorNotificationManager {
return null;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- createNotificationChannel(notificationManager);
+ createNotificationChannel(context, notificationManager);
}
return notificationManager;
}
@TargetApi(26)
- private static void createNotificationChannel(NotificationManager notificationManager) {
- CharSequence name = "Bitmask Tor Service";
- String description = "Informs about usage of bridges to configure Bitmask.";
+ private static void createNotificationChannel(Context context, NotificationManager notificationManager) {
+ String appName = context.getString(R.string.app_name);
+ CharSequence name = context.getString(R.string.channel_name_tor_service, appName);
+ String description = context.getString(R.string.channel_description_tor_service, appName);
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_NEWSTATUS_ID,
name,
NotificationManager.IMPORTANCE_LOW);
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 0b3d1d9b..dbaf0f0b 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -174,6 +174,8 @@
<string name="log_ap_handshake_done">Handshake finished with a relay to build circuits</string>
<string name="log_circuit_create">Establishing a Tor circuit</string>
<string name="log_done">Running</string>
+ <string name="channel_name_tor_service">%s Bridges Service</string>
+ <string name="channel_description_tor_service">Informs about usage of bridges while configuring %s.</string>
</resources>