Commit 34be9f22 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Added a setting to disable showing the notification when the VPN is revoked

parent 99687086
...@@ -742,7 +742,7 @@ class DnsVpnService : VpnService(), Runnable { ...@@ -742,7 +742,7 @@ class DnsVpnService : VpnService(), Runnable {
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
BackgroundVpnConfigureActivity.prepareVpn(this, userServerConfig) BackgroundVpnConfigureActivity.prepareVpn(this, userServerConfig)
}, 250) }, 250)
} else { } else if(getPreferences().showNotificationOnRevoked){
NotificationCompat.Builder(this, Notifications.getHighPriorityChannelId(this)).apply { NotificationCompat.Builder(this, Notifications.getHighPriorityChannelId(this)).apply {
setSmallIcon(R.drawable.ic_cloud_warn) setSmallIcon(R.drawable.ic_cloud_warn)
setContentTitle(getString(R.string.notification_service_revoked_title)) setContentTitle(getString(R.string.notification_service_revoked_title))
......
...@@ -182,6 +182,7 @@ class AppSettingsSharedPreferences(context: Context) : AppSettings, SimpleTypedP ...@@ -182,6 +182,7 @@ class AppSettingsSharedPreferences(context: Context) : AppSettings, SimpleTypedP
override var hideNotificationIcon: Boolean by booleanPref("hide_notification_icon", false) override var hideNotificationIcon: Boolean by booleanPref("hide_notification_icon", false)
override var allowPauseInNotification: Boolean by booleanPref("notification_allow_pause", true) override var allowPauseInNotification: Boolean by booleanPref("notification_allow_pause", true)
override var allowStopInNotification: Boolean by booleanPref("notification_allow_stop", true) override var allowStopInNotification: Boolean by booleanPref("notification_allow_stop", true)
var showNotificationOnRevoked:Boolean by booleanPref("show_vpn_revoked_notification", true)
override var enablePin:Boolean by booleanPref("enable_pin", false) override var enablePin:Boolean by booleanPref("enable_pin", false)
override var allowFingerprintForPin:Boolean by booleanPref("pin_allow_fingerprint", true) override var allowFingerprintForPin:Boolean by booleanPref("pin_allow_fingerprint", true)
......
...@@ -36,6 +36,12 @@ ...@@ -36,6 +36,12 @@
<string name="title_notification_allow_pause">Allow pausing</string> <string name="title_notification_allow_pause">Allow pausing</string>
<string name="summary_notification_allow_pause">Allow the app to be paused from the notification</string> <string name="summary_notification_allow_pause">Allow the app to be paused from the notification</string>
<string name="title_show_noconnection_notification">Notification on no connection</string>
<string name="summary_show_noconnection_notification">Show a notification when the app has no or a bad connection</string>
<string name="title_show_revoked_notification">Notification on permission lost</string>
<string name="summary_show_revoked_notification">Show a notification when Nebulo loses permission to the VPN</string>
<string name="preference_category_pin">PIN protection</string> <string name="preference_category_pin">PIN protection</string>
...@@ -134,9 +140,6 @@ ...@@ -134,9 +140,6 @@
<string name="title_pause_on_captiveportal">Pause on captive portal</string> <string name="title_pause_on_captiveportal">Pause on captive portal</string>
<string name="summary_pause_on_captiveportal">Don\'t use DoH if a captive portal is detected. It will automatically be resumed shortly after logging in.\nDisabling it might prevent you from opening the captive portal site to log in.</string> <string name="summary_pause_on_captiveportal">Don\'t use DoH if a captive portal is detected. It will automatically be resumed shortly after logging in.\nDisabling it might prevent you from opening the captive portal site to log in.</string>
<string name="title_show_noconnection_notification">Notification on no connection</string>
<string name="summary_show_noconnection_notification">Show a notification when the app has no or a bad connection</string>
<string name="preference_category_querylogging">Query logging</string> <string name="preference_category_querylogging">Query logging</string>
......
...@@ -37,5 +37,11 @@ ...@@ -37,5 +37,11 @@
android:key="show_no_connection_notification" android:key="show_no_connection_notification"
android:summary="@string/summary_show_noconnection_notification" android:summary="@string/summary_show_noconnection_notification"
android:title="@string/title_show_noconnection_notification" /> android:title="@string/title_show_noconnection_notification" />
<CheckBoxPreference
android:defaultValue="true"
android:key="show_vpn_revoked_notification"
android:summary="@string/summary_show_revoked_notification"
android:title="@string/title_show_revoked_notification" />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
\ No newline at end of file
Supports Markdown
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