summaryrefslogtreecommitdiff
path: root/app/src/main/java/de
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-05-22 20:28:08 +0200
committercyBerta <cyberta@riseup.net>2019-05-22 20:28:08 +0200
commit7dc9f9e9caf41976d08c967d2d966648c99f929b (patch)
treea00be0a81bf0c8cf179c85b6f8058bd77e74db52 /app/src/main/java/de
parente92081d9aff29b0f2592ab960593c59b5db41dbc (diff)
* adds a DISCONNECTING state
* fixes vpn startup issues
Diffstat (limited to 'app/src/main/java/de')
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java25
1 files changed, 16 insertions, 9 deletions
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 e42e36bb..af31e977 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -237,15 +237,22 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
}
@Override
- public boolean stopVPN(boolean replaceConnection) throws RemoteException {
- if (getManagement() != null && getManagement().stopVPN(replaceConnection)) {
- if (!replaceConnection) {
- VpnStatus.updateStateString("NOPROCESS", "VPN STOPPED", R.string.state_noprocess, ConnectionStatus.LEVEL_NOTCONNECTED);
- }
- return true;
- } else {
- return false;
- }
+ public boolean stopVPN(boolean replaceConnection) {
+ if(isVpnRunning()) {
+ if (getManagement() != null && getManagement().stopVPN(replaceConnection)) {
+ if (!replaceConnection) {
+ VpnStatus.updateStateString("NOPROCESS", "VPN STOPPED", R.string.state_noprocess, ConnectionStatus.LEVEL_NOTCONNECTED);
+ }
+ return true;
+ }
+ return false;
+ } else {
+ if (!replaceConnection) {
+ VpnStatus.updateStateString("NOPROCESS", "VPN STOPPED", R.string.state_noprocess, ConnectionStatus.LEVEL_NOTCONNECTED);
+ return true;
+ }
+ return false;
+ }
}
/**