diff options
author | Parménides GV <parmegv@sdf.org> | 2015-03-09 12:18:10 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-03-09 12:18:10 +0100 |
commit | 67c4d2acd09becc9752f4a2066ec4c5c4736e001 (patch) | |
tree | 516f407e2fcf135271962ed0056b095baf7fe7ec /app/src/main/java/se | |
parent | 4028c100a59c45913cb569c4967faaddc090b1f9 (diff) | |
parent | 767f2982ec62e071396226415f5abda2fb6cb3f2 (diff) |
Merge branch 'bug/If-VPN-connection-fails,-blocking-VPN-isn't-turned-off-6777' into develop
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java index 4ac3bd6a..c6735130 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -44,18 +44,23 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { @Override public void updateState(final String state, final String logmessage, final int localizedResId, final VpnStatus.ConnectionStatus level) { + updateStatus(state, logmessage, localizedResId, level); + if(isConnected() || isDisconnected()) { + setConnectedOrDisconnected(); + if(isDisconnected()) + VoidVpnService.stop(); + } else if(isConnecting()) + setConnecting(); + Log.d(TAG, "update state with level " + level); + } + + private void updateStatus(final String state, final String logmessage, final int localizedResId, final VpnStatus.ConnectionStatus level) { current_status = getInstance(); current_status.setState(state); current_status.setLogMessage(logmessage); current_status.setLocalizedResId(localizedResId); current_status.setLevel(level); current_status.setChanged(); - if(isConnected() || isDisconnected()) - setConnectedOrDisconnected(); - else if(isConnecting()) - setConnecting(); - Log.d(TAG, "update state with level " + level); - current_status.notifyObservers(); } public boolean wantsToDisconnect() { |