Commit b77a2b95 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Add notification channel for #263

(cherry picked from commit ae52a39d)
parent f67e1349
......@@ -140,6 +140,23 @@ class Notifications {
}
return "dnsrule_channel"
}
fun getBadConnectionChannelId(context: Context):String {
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
val channel = NotificationChannel(
"badconnection_channel",
context.getString(R.string.notification_channel_dnsrules),
NotificationManager.IMPORTANCE_DEFAULT
)
channel.enableLights(false)
channel.enableVibration(false)
channel.setSound(null, null)
channel.description = context.getString(R.string.notification_channel_dnsrules_description)
channel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC
(context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).createNotificationChannel(channel)
}
return "badconnection_channel"
}
}
}
......
......@@ -18,6 +18,9 @@
<string name="notification_channel_dnsrules">DNS Rule Notification Channel</string>
<string name="notification_channel_dnsrules_description">Channel used for import/export of DNS rules</string>
<string name="notification_channel_badconnection">Bad connection notification channel</string>
<string name="notification_channel_badconnection_description">Channel used for notifications when Nebulo has a bad connection</string>
<string name="notification_simple_text">Current server: %1$s</string>
<string name="notification_main_text">Queries are sent to %1$s\n\n%2$d Apps are excluded from DoH/DoT\n%3$d entries in the cache</string>
<string name="notification_main_text_with_secondary">Queries are sent to %1$s and %2$s\n\n%3$d Apps are excluded from DoH/DoT\n%4$d entries in the cache</string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment