From f1644007280d48e789b3533eaf159724b05c67c3 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 1 Nov 2023 04:05:14 +0100 Subject: ensure that the blocking VPN notification always disappears if openvpn is (re-)started --- app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.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 575f1f59..b38eeb14 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -277,6 +277,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac // Always show notification here to avoid problem with startForeground timeout notificationManager.createOpenVpnNotificationChannel(); notificationManager.buildForegroundServiceNotification(EipStatus.getInstance().getLevel(), this::onNotificationBuild); + notificationManager.cancelVoidVpnServiceNotifications(); } @Override @@ -329,7 +330,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac updateShortCutUsage(mProfile); } VpnStatus.setAlwaysOn(false); - + notificationManager.cancelVoidVpnServiceNotifications(); } else { /* The intent is null when we are set as always-on or the service has been restarted. */ Log.d(TAG, "Starting VPN due to isAlwaysOn system settings or app crash."); -- cgit v1.2.3