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.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,6 +313,10 @@ public class VpnStateFragment extends Fragment implements VpnStateListener
|
||||
|
||||
private void clearError()
|
||||
{
|
||||
if (mService != null)
|
||||
{
|
||||
mService.disconnect();
|
||||
}
|
||||
mDismissedConnectionID = mErrorConnectionID;
|
||||
updateView();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user