diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-07-14 15:43:06 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2014-07-22 10:55:51 +0200 |
commit | 394be2d5563eedf284984f8180e51353af45a621 (patch) | |
tree | 062cf0f8ce177a4f062bc8b70ccb2ea263fb13d8 | |
parent | 08d545e29aa57277c520df0d02f99b6591db0a35 (diff) | |
download | strongswan-394be2d5563eedf284984f8180e51353af45a621.tar.bz2 strongswan-394be2d5563eedf284984f8180e51353af45a621.tar.xz |
android: Delay disconnecting on errors until user dismisses them
If e.g. reauthentication fails we don't want to close the TUN device
until the user acknowledged the error and is thus aware of the failure.
-rw-r--r-- | src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java | 6 | ||||
-rw-r--r-- | src/frontends/android/src/org/strongswan/android/ui/VpnStateFragment.java | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java b/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java index 13024512e..d53d478b2 100644 --- a/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java +++ b/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java @@ -322,9 +322,8 @@ public class CharonVpnService extends VpnService implements Runnable } /** - * Set an error on the state service and disconnect the current connection. - * This is not done by calling stopCurrentConnection() above, but instead - * is done asynchronously via state service. + * Set an error on the state service. Called by the handler thread and any + * of charon's threads. * * @param error error state */ @@ -337,7 +336,6 @@ public class CharonVpnService extends VpnService implements Runnable if (!mIsDisconnecting) { mService.setError(error); - mService.disconnect(); } } } diff --git a/src/frontends/android/src/org/strongswan/android/ui/VpnStateFragment.java b/src/frontends/android/src/org/strongswan/android/ui/VpnStateFragment.java index f0a03a513..160ba951b 100644 --- a/src/frontends/android/src/org/strongswan/android/ui/VpnStateFragment.java +++ b/src/frontends/android/src/org/strongswan/android/ui/VpnStateFragment.java @@ -313,6 +313,10 @@ public class VpnStateFragment extends Fragment implements VpnStateListener private void clearError() { + if (mService != null) + { + mService.disconnect(); + } mDismissedConnectionID = mErrorConnectionID; updateView(); } |