diff options
author | Eric Kuck <eric@bluelinelabs.com> | 2018-07-25 19:30:34 -0500 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-26 05:17:43 +0200 |
commit | 9652fe99df68db5c483ea8e170f6e09f06a5e0d1 (patch) | |
tree | d88fa5ef4fa4e53d605e6bce9d788960a80642de /app/src/main/java/com/wireguard/android/backend | |
parent | 62d8beff9693080225fe550d82f105ba3cde5df2 (diff) |
TunnelDetailFragment now restores state correctly after process death
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/backend')
-rw-r--r-- | app/src/main/java/com/wireguard/android/backend/GoBackend.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/src/main/java/com/wireguard/android/backend/GoBackend.java b/app/src/main/java/com/wireguard/android/backend/GoBackend.java index a075913f..605f00eb 100644 --- a/app/src/main/java/com/wireguard/android/backend/GoBackend.java +++ b/app/src/main/java/com/wireguard/android/backend/GoBackend.java @@ -240,10 +240,13 @@ public final class GoBackend implements Backend { @Override public void onDestroy() { - for (final Tunnel tunnel : Application.getTunnelManager().getTunnels()) { - if (tunnel != null && tunnel.getState() != State.DOWN) - tunnel.setState(State.DOWN); - } + Application.getTunnelManager().getTunnels().thenAccept(tunnels -> { + for (final Tunnel tunnel : tunnels) { + if (tunnel != null && tunnel.getState() != State.DOWN) + tunnel.setState(State.DOWN); + } + }); + vpnService = vpnService.newIncompleteFuture(); super.onDestroy(); } |