diff options
Diffstat (limited to 'tunnel/src/main/java/com')
-rw-r--r-- | tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java | 11 |
1 files changed, 4 insertions, 7 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 5c3bf111..85c60349 100644 --- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java +++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java @@ -214,8 +214,10 @@ public final class GoBackend implements Backend { throw new BackendException(Reason.VPN_NOT_AUTHORIZED); final VpnService service; - if (!vpnService.isDone()) - startVpnService(); + if (!vpnService.isDone()) { + Log.d(TAG, "Requesting to start VpnService"); + context.startService(new Intent(context, VpnService.class)); + } try { service = vpnService.get(2, TimeUnit.SECONDS); @@ -302,11 +304,6 @@ public final class GoBackend implements Backend { tunnel.onStateChange(state); } - private void startVpnService() { - Log.d(TAG, "Requesting to start VpnService"); - context.startService(new Intent(context, VpnService.class)); - } - /** * Callback for {@link GoBackend} that is invoked when {@link VpnService} is started by the * system's Always-On VPN mode. |