diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-09-21 12:25:46 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-09-21 12:25:46 -0300 |
| commit | 81732d99c82fbf7279a843a2764f87b41ac54528 (patch) | |
| tree | f6e4c11f71121fee174b19891ee784dd952c89f7 | |
| parent | 79b0e80f63d6926d4ebf52b83f7acdfb5e10683c (diff) | |
| parent | f2699905c55333b098618e1b6237104237c009fa (diff) | |
| download | mullvadvpn-81732d99c82fbf7279a843a2764f87b41ac54528.tar.xz mullvadvpn-81732d99c82fbf7279a843a2764f87b41ac54528.zip | |
Merge branch 'fix-reconnect-anticipation'
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/ConnectionProxy.kt | 23 |
2 files changed, 19 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 06ba1065f9..8eb7920c9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,8 @@ Line wrap the file at 100 chars. Th blocking state and sometimes open the UI for the user to login. Now it always opens the UI. - Mark the VPN connection as not metered, so that Android properly reports if the connection is or isn't metered based solely on the underlying network, and not on the VPN connection. +- Fix connect action button sometimes showing itself as "Cancel" instead of "Secure my connection" + for a few seconds. #### Linux - Fix split tunneling rules preventing `systemd-resolved` from performing DNS lookups for excluded diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ConnectionProxy.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ConnectionProxy.kt index bc89cc6c1e..eae5fa0219 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ConnectionProxy.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ConnectionProxy.kt @@ -109,15 +109,26 @@ class ConnectionProxy(val context: Context, val daemon: MullvadDaemon) { synchronized(this) { val currentState = uiState - if (currentState is TunnelState.Disconnecting && - currentState.actionAfterDisconnect == ActionAfterDisconnect.Reconnect - ) { - return false - } else { + val willReconnect = when (currentState) { + is TunnelState.Disconnected -> false + is TunnelState.Disconnecting -> { + when (currentState.actionAfterDisconnect) { + ActionAfterDisconnect.Nothing -> false + ActionAfterDisconnect.Reconnect -> false + ActionAfterDisconnect.Block -> true + } + } + is TunnelState.Connecting -> true + is TunnelState.Connected -> true + is TunnelState.Error -> true + } + + if (willReconnect) { scheduleToResetAnticipatedState() uiState = TunnelState.Disconnecting(ActionAfterDisconnect.Reconnect) - return true } + + return willReconnect } } |
