summaryrefslogtreecommitdiff
path: root/app/java/src/DNSService.java
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-04-29 10:07:00 +0200
committerDaniel Weipert <code@drogueronin.de>2023-04-29 10:07:00 +0200
commit2259ae916239a3e6a84226583edc610a578cb98e (patch)
treefe439e1985b795832d4cad62c583b21dc6cfc832 /app/java/src/DNSService.java
initial commit
Diffstat (limited to 'app/java/src/DNSService.java')
-rw-r--r--app/java/src/DNSService.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/app/java/src/DNSService.java b/app/java/src/DNSService.java
new file mode 100644
index 0000000..4f760a5
--- /dev/null
+++ b/app/java/src/DNSService.java
@@ -0,0 +1,33 @@
+package org.pihole.dnsproxy;
+
+import android.app.AlertDialog;
+import android.app.Service;
+
+import android.content.Intent;
+
+import android.net.VpnService;
+
+public class DNSService extends VpnService {
+
+ private static boolean isRunning = false;
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ //VpnService.prepare();
+
+ DNSService.isRunning = true;
+
+ return Service.START_STICKY;
+ }
+
+ @Override
+ public void onDestroy() {
+ DNSService.isRunning = false;
+ super.onDestroy();
+ }
+
+ public static boolean isRunning()
+ {
+ return DNSService.isRunning;
+ }
+}