summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java')
-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;
+ }
}
/**