diff options
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVPN.java')
-rw-r--r-- | src/de/blinkt/openvpn/OpenVPN.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/OpenVPN.java b/src/de/blinkt/openvpn/OpenVPN.java index 24281d13..1d9eb6e0 100644 --- a/src/de/blinkt/openvpn/OpenVPN.java +++ b/src/de/blinkt/openvpn/OpenVPN.java @@ -10,12 +10,16 @@ public class OpenVPN { public static LinkedList<String> logbuffer = new LinkedList<String>(); private static Vector<LogListener> logListener=new Vector<OpenVPN.LogListener>(); + private static Vector<SpeedListener> speedListener=new Vector<OpenVPN.SpeedListener>(); private static String[] mBconfig; public interface LogListener { void newLog(String logmessage); } + public interface SpeedListener { + void updateSpeed(String logmessage); + } synchronized static void logMessage(int level,String prefix, String message) { @@ -41,6 +45,16 @@ public class OpenVPN { logListener.remove(ll); } + + synchronized static void addSpeedListener(SpeedListener sl){ + speedListener.add(sl); + } + + synchronized static void removeSpeedListener(SpeedListener sl) { + speedListener.remove(sl); + } + + synchronized public static String[] getlogbuffer() { @@ -62,4 +76,10 @@ public class OpenVPN { } } + + public static void updateSpeedString(String msg) { + for (SpeedListener sl : speedListener) { + sl.updateSpeed(msg); + } + } } |