diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-04-11 19:17:55 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-04-11 19:17:55 +0200 |
commit | 3907f6a4c1af2ef5925cc589eb72bc16c09ecaca (patch) | |
tree | a816054cb57e8e8a86955eedf1464e7b38791110 /tunnel/src/main/java/com/wireguard/android | |
parent | 652971d74655b0aa0c754d7de869b36abe9eaafa (diff) |
tunnel: do not keep service running when bringing tunnel down
Doing so causes the process to restart when the activity is cleared,
even when no tunnel is running. I fear this might also lead to the
current flurry of DeadSystemExceptions.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tunnel/src/main/java/com/wireguard/android')
-rw-r--r-- | tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java index ef06ebe7..670f04a1 100644 --- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java +++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java @@ -324,6 +324,9 @@ public final class GoBackend implements Backend { currentTunnelHandle = -1; currentConfig = null; wgTurnOff(handleToClose); + try { + vpnService.get(0, TimeUnit.NANOSECONDS).stopSelf(); + } catch (final TimeoutException ignored) { } } tunnel.onStateChange(state); |