diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java index 69210881..632dc878 100644 --- a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java +++ b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java @@ -29,7 +29,14 @@ public class ObfsVpnClient implements Observer { public void start() { synchronized (LOCK) { Log.d(TAG, "aquired LOCK"); - new Thread(obfsVpnClient::start).start(); + new Thread(() -> { + try { + obfsVpnClient.start(); + } catch (Exception e) { + e.printStackTrace(); + } + }).start(); + try { Thread.sleep(500); } catch (InterruptedException e) { @@ -42,10 +49,21 @@ public class ObfsVpnClient implements Observer { public void stop() { synchronized (LOCK) { Log.d(TAG, "stopping obfsVpnClient..."); - obfsVpnClient.stop(); + try { + obfsVpnClient.stop(); + Thread.sleep(500); + } catch (Exception e) { + e.printStackTrace(); + VpnStatus.logError("[obfsvpn] " + e.getLocalizedMessage()); + } + Log.d(TAG, "stopping obfsVpnClient releasing LOCK ..."); } } + public boolean isStarted() { + return obfsVpnClient.isStarted(); + } + @Override public void update(Observable observable, Object arg) { if (observable instanceof EipStatus) { |