summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@blinkt.de>2012-07-07 11:18:29 +0200
committerArne Schwabe <arne@blinkt.de>2012-07-07 11:18:29 +0200
commit4afb3907aaf92406cc7975f4b1b3723e52d4ab6c (patch)
tree07b1d8f499ddd5b307cd15feaca251c4c75d922f
parent7bdc51c2a9ad53e194f4966085cc7a0a890235e4 (diff)
Fix stale "exiting" status
-rw-r--r--res/values-es/arrays.xml13
-rw-r--r--src/de/blinkt/openvpn/OpenVpnService.java20
2 files changed, 12 insertions, 21 deletions
diff --git a/res/values-es/arrays.xml b/res/values-es/arrays.xml
index e83a7a39..ed33c8c7 100644
--- a/res/values-es/arrays.xml
+++ b/res/values-es/arrays.xml
@@ -16,19 +16,6 @@
<item>"1"</item>
<item>"Sin especificar"</item>
</string-array>
- <string-array name="tls_directions_values" translatable="false">
- <item>"0"</item>
- <item>"1"</item>
- <item/>
- </string-array>
- <string-array name="verb_values" translatable="false">
- <item>"0"</item>
- <item>"1"</item>
- <item>"2"</item>
- <item>"3"</item>
- <item>"4"</item>
- <item>"5"</item>
- </string-array>
<string-array name="verb_entries">
<item>"0 - No hay registro"</item>
<item>"1 - Detalle prederminado"</item>
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);