From bab6645cfb1eb9321e67482d862314a1dbf14f95 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 25 Feb 2013 14:15:33 +0100 Subject: Fix notificationalwaysvisible bug --- src/de/blinkt/openvpn/OpenVPN.java | 2 +- src/de/blinkt/openvpn/OpenVpnService.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/de/blinkt/openvpn/OpenVPN.java b/src/de/blinkt/openvpn/OpenVPN.java index fb759104..0dc5a871 100644 --- a/src/de/blinkt/openvpn/OpenVPN.java +++ b/src/de/blinkt/openvpn/OpenVPN.java @@ -297,7 +297,7 @@ public class OpenVPN { private static int getLevel(String state){ String[] noreplyet = {"CONNECTING","WAIT", "RECONNECTING", "RESOLVE", "TCP_CONNECT"}; - String[] reply = {"AUTH","GETCONFIG","ASSIGN_IP","ADD_ROUTES"}; + String[] reply = {"AUTH","GET_CONFIG","ASSIGN_IP","ADD_ROUTES"}; String[] connected = {"CONNECTED"}; String[] notconnected = {"DISCONNECTED", "EXITING"}; diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java index 66ab9e30..cecae9d1 100644 --- a/src/de/blinkt/openvpn/OpenVpnService.java +++ b/src/de/blinkt/openvpn/OpenVpnService.java @@ -114,15 +114,16 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac private void endVpnService() { mProcessThread=null; OpenVPN.logBuilderConfig(null); - OpenVPN.removeStateListener(this); OpenVPN.removeByteCountListener(this); unregisterNetworkStateReceiver(); ProfileManager.setConntectedVpnProfileDisconnected(this); if(!mStarting) { stopForeground(!mNotificationalwaysVisible); - if( !mNotificationalwaysVisible) + if( !mNotificationalwaysVisible) { stopSelf(); + OpenVPN.removeStateListener(this); + } } } @@ -351,6 +352,8 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac if (mNetworkStateReceiver!= null) { this.unregisterReceiver(mNetworkStateReceiver); } + // Just in case unregister for state + OpenVPN.removeStateListener(this); } -- cgit v1.2.3