diff options
author | Arne Schwabe <arne@blinkt.de> | 2012-07-07 11:18:29 +0200 |
---|---|---|
committer | Arne Schwabe <arne@blinkt.de> | 2012-07-07 11:18:29 +0200 |
commit | b07eb38151644d9b0e19ccfb2e97b468b08b2d4a (patch) | |
tree | 8f597348c413a83948b15611b54deee3966768b5 /src | |
parent | 373a5b710b6fa2a435db97fd40b7ca1d2abf0dd4 (diff) |
Fix stale "exiting" statusv0.5.10
Diffstat (limited to 'src')
-rw-r--r-- | src/de/blinkt/openvpn/OpenVpnService.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java index 3c836afa..c50196b8 100644 --- a/src/de/blinkt/openvpn/OpenVpnService.java +++ b/src/de/blinkt/openvpn/OpenVpnService.java @@ -53,12 +53,12 @@ public class OpenVpnService extends VpnService implements StateListener { private Thread mSocketManagerThread; private int mMtu; private String mLocalIPv6=null; - private Notification mNotification=null; - private NetworkSateReceiver mNetworkStateReceiver; private boolean mDisplayBytecount=false; + private boolean mNotificationvisible; + private static final int OPENVPN_STATUS = 1; @Override @@ -72,7 +72,7 @@ public class OpenVpnService extends VpnService implements StateListener { String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); mNotificationManager.cancel(OPENVPN_STATUS); - + mNotificationvisible=false; } private void showNotification(String msg, String tickerText) { String ns = Context.NOTIFICATION_SERVICE; @@ -95,12 +95,10 @@ public class OpenVpnService extends VpnService implements StateListener { if(tickerText!=null) nbuilder.setTicker(tickerText); - mNotification = nbuilder.getNotification(); - + Notification notification = nbuilder.getNotification(); - - - mNotificationManager.notify(OPENVPN_STATUS, mNotification); + mNotificationManager.notify(OPENVPN_STATUS, notification); + mNotificationvisible=true; } @@ -394,6 +392,12 @@ public class OpenVpnService extends VpnService implements StateListener { } } + // Skip exiting status if the status is already hidden + if("EXITING SIGINT".equals(state) && !mNotificationvisible) { + return; + } + + if("BYTECOUNT".equals(state)) { if(mDisplayBytecount) { showNotification(logmessage,null); |