From 04000ea89257cb5d3141be9dfc18f96ad8a2ea96 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sat, 27 Feb 2021 00:36:11 +0100 Subject: no need to delete notification channels on service destroy --- app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 4 +--- app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java | 2 +- .../java/se/leap/bitmaskclient/eip/VpnNotificationManager.java | 8 +------- 3 files changed, 3 insertions(+), 11 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index a734dd90..9ed2054e 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -8,12 +8,10 @@ package de.blinkt.openvpn.core; import android.Manifest.permission; import android.annotation.TargetApi; import android.app.Notification; -import android.app.UiModeManager; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.pm.ShortcutManager; -import android.content.res.Configuration; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.VpnService; @@ -538,7 +536,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac VpnStatus.removeStateListener(this); VpnStatus.flushLog(); firewallManager.onDestroy(); - notificationManager.deleteOpenvpnNotificationChannel(); + notificationManager.cancelAll(); } private String getTunConfigString() { diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java index 68ad78e4..02de7574 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java @@ -119,7 +119,7 @@ public class VoidVpnService extends VpnService implements Observer, VpnNotificat @Override public void onDestroy() { super.onDestroy(); - notificationManager.deleteVoidVpnNotificationChannel(); + notificationManager.cancelAll(); } private void stop() { diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VpnNotificationManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/VpnNotificationManager.java index b007715b..6fac0f72 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VpnNotificationManager.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VpnNotificationManager.java @@ -195,14 +195,8 @@ public class VpnNotificationManager { buildOpenVpnNotification(profileName, isObfuscated, msg, tickerText, status, when, notificationChannelNewstatusId, null); } - public void deleteOpenvpnNotificationChannel() { + public void cancelAll() { compatNotificationManager.cancelAll(); - compatNotificationManager.deleteNotificationChannel(OpenVPNService.NOTIFICATION_CHANNEL_NEWSTATUS_ID); - } - - public void deleteVoidVpnNotificationChannel() { - compatNotificationManager.cancelAll(); - compatNotificationManager.deleteNotificationChannel(VoidVpnService.NOTIFICATION_CHANNEL_NEWSTATUS_ID); } -- cgit v1.2.3