diff options
Diffstat (limited to 'app/java/src/DNSProxyConnection.java')
-rw-r--r-- | app/java/src/DNSProxyConnection.java | 12 |
1 files changed, 5 insertions, 7 deletions
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); } } } |