From 7f0436aa2a782d926a81bd5bdf76baf0253582da Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 12 May 2023 13:12:57 +0200 Subject: working commit --- app/java/src/DNSProxyConnection.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'app/java/src/DNSProxyConnection.java') diff --git a/app/java/src/DNSProxyConnection.java b/app/java/src/DNSProxyConnection.java index f96af80..0573515 100644 --- a/app/java/src/DNSProxyConnection.java +++ b/app/java/src/DNSProxyConnection.java @@ -4,8 +4,6 @@ import android.os.ParcelFileDescriptor; import android.util.Log; -import java.io.IOException; - public class DNSProxyConnection { public static String THREAD_NAME = "org.pihole.dnsproxy.service.thread"; @@ -20,8 +18,8 @@ public class DNSProxyConnection { public void start() { DNSProxyRunner runner = new DNSProxyRunner(this.service); - runner.setOnEstablishListener(parcelFileDescriptor -> { - this.networkInterface = parcelFileDescriptor; + runner.setOnEstablishListener(tunInterface -> { + this.networkInterface = tunInterface; }); this.thread = new Thread(runner, DNSProxyConnection.THREAD_NAME); @@ -30,10 +28,10 @@ public class DNSProxyConnection { public void stop() { try { - this.thread.stop(); + this.thread.interrupt(); this.networkInterface.close(); - } catch (IOException exception) { - Log.e(DNSProxyService.LOG_TAG, "Connection failed", exception); + } catch (Exception exception) { + Log.e(DNSProxyService.LOG_TAG, "Closing VPN interface", exception); } } } -- cgit v1.2.3