summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVPN.java
diff options
context:
space:
mode:
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);
}