diff options
Diffstat (limited to 'app/src/main/java/de/blinkt')
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/ConnectionStatus.java | 1 | ||||
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/ConnectionStatus.java b/app/src/main/java/de/blinkt/openvpn/core/ConnectionStatus.java index 03d842e3..3e6d23f7 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/ConnectionStatus.java +++ b/app/src/main/java/de/blinkt/openvpn/core/ConnectionStatus.java @@ -21,6 +21,7 @@ public enum ConnectionStatus implements Parcelable { LEVEL_START, LEVEL_AUTH_FAILED, LEVEL_WAITING_FOR_USER_INPUT, + LEVEL_BLOCKING, // used for Bitmask's VoidVPN UNKNOWN_LEVEL; @Override diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index ded7490a..86e1bb02 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -115,6 +115,11 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac public boolean stopVPN(boolean replaceConnection) throws RemoteException { return OpenVPNService.this.stopVPN(replaceConnection); } + + @Override + public boolean isVpnRunning() throws RemoteException { + return OpenVPNService.this.isVpnRunning(); + } }; // From: http://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java @@ -412,6 +417,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac } + @Override public void userPause(boolean shouldBePaused) { if (mDeviceStateReceiver != null) mDeviceStateReceiver.userPause(shouldBePaused); @@ -425,6 +431,20 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac return false; } + /** + * used in Bitmask + */ + @Override + public boolean isVpnRunning() { + boolean hasVPNProcessThread = false; + synchronized (mProcessLock) { + hasVPNProcessThread = mProcessThread != null && mProcessThread.isAlive(); + } + + return hasVPNProcessThread; + + } + @Override public int onStartCommand(Intent intent, int flags, int startId) { |