summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android/backend
diff options
context:
space:
mode:
authorEric Kuck <eric@bluelinelabs.com>2018-07-25 19:30:34 -0500
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-26 05:17:43 +0200
commit9652fe99df68db5c483ea8e170f6e09f06a5e0d1 (patch)
treed88fa5ef4fa4e53d605e6bce9d788960a80642de /app/src/main/java/com/wireguard/android/backend
parent62d8beff9693080225fe550d82f105ba3cde5df2 (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.java11
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();
}