summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVPN.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-08-28 01:14:05 +0200
committerArne Schwabe <arne@rfc2549.org>2012-08-28 01:14:05 +0200
commit4483c357fee4688a1604dd1cbf5b6262bbbf4e75 (patch)
tree4e915eba8ca868e148f062690e72d9b413e20c1d /src/de/blinkt/openvpn/OpenVPN.java
parentc6526d53d31c7520c7c6ad575e0f61a40663ab4f (diff)
- Add status message when waiting for network.
- Using a priority higher than PRIORITY_MIN stop the flickering of the notification but make the icon visible again :/
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVPN.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVPN.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/de/blinkt/openvpn/OpenVPN.java b/src/de/blinkt/openvpn/OpenVPN.java
index db980200..6b65c22e 100644
--- a/src/de/blinkt/openvpn/OpenVPN.java
+++ b/src/de/blinkt/openvpn/OpenVPN.java
@@ -14,6 +14,10 @@ public class OpenVPN {
private static Vector<LogListener> logListener;
private static Vector<StateListener> stateListener;
private static String[] mBconfig;
+
+ private static String mLaststatemsg;
+
+ private static String mLaststate;
static {
logbuffer = new LinkedList<LogItem>();
@@ -117,8 +121,10 @@ public class OpenVPN {
}
- synchronized static void addSpeedListener(StateListener sl){
+ synchronized static void addStateListener(StateListener sl){
stateListener.add(sl);
+ if(mLaststate!=null)
+ sl.updateState(mLaststate, mLaststatemsg);
}
synchronized static void removeSpeedListener(StateListener sl) {
@@ -148,6 +154,9 @@ public class OpenVPN {
}
public synchronized static void updateStateString(String state, String msg) {
+ mLaststate= state;
+ mLaststatemsg = msg;
+
for (StateListener sl : stateListener) {
sl.updateState(state,msg);
}