diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-05-19 12:28:24 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-05-19 12:28:24 +0200 |
commit | f47c908c88875c32fd4c624aeecefbf660c17e85 (patch) | |
tree | 659fd0d6a854d9af06275172e21a8e9e9fc8cc65 /app/java/src/DNSProxyService.java | |
parent | 309993eec6085cfa0e112cd5f45c8c55beeee5db (diff) |
cleanup and comments
Diffstat (limited to 'app/java/src/DNSProxyService.java')
-rw-r--r-- | app/java/src/DNSProxyService.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/app/java/src/DNSProxyService.java b/app/java/src/DNSProxyService.java index 2b2147f..5a3d70f 100644 --- a/app/java/src/DNSProxyService.java +++ b/app/java/src/DNSProxyService.java @@ -23,10 +23,10 @@ import java.net.InetAddress; public class DNSProxyService extends VpnService { public static String LOG_TAG = "org.pihole.dnsproxy.log"; - public static String NOTIFICATION = "org.pihole.dnsproxy.service"; - public static String NOTIFICATION_CHANNEL_ID = "PiholeDNSProxy"; - public static String ACTION_START = "org.pihole.dnsproxy.service.START"; - public static String ACTION_STOP = "org.pihole.dnsproxy.service.STOP"; + public static String NOTIFICATION_NOTIFY = "org.pihole.dnsproxy.service.dnsproxy.notification.NOTIFY"; + public static String NOTIFICATION_CHANNEL_ID = "org.pihole.dnsproxy.service.dnsproxy.NOTIFICATION"; + public static String ACTION_START = "org.pihole.dnsproxy.service.dnsproxy.START"; + public static String ACTION_STOP = "org.pihole.dnsproxy.service.dnsproxy.STOP"; public static String PIHOLE_ADDRESS = ""; @@ -52,10 +52,16 @@ public class DNSProxyService extends VpnService { super.onDestroy(); } + /** + * Builder has to be created by service + */ public VpnService.Builder newBuilder() { return new VpnService.Builder(); } + /** + * Whether the proxy is setup running + */ public static boolean isRunning() { return DNSProxyService.connection != null; @@ -87,7 +93,7 @@ public class DNSProxyService extends VpnService { this.startForeground(); // send notification when started - Intent notification = new Intent(DNSProxyService.NOTIFICATION); + Intent notification = new Intent(DNSProxyService.NOTIFICATION_NOTIFY); sendBroadcast(notification); } @@ -101,7 +107,7 @@ public class DNSProxyService extends VpnService { stopForeground(true); // send notification when stopped - Intent notification = new Intent(DNSProxyService.NOTIFICATION); + Intent notification = new Intent(DNSProxyService.NOTIFICATION_NOTIFY); sendBroadcast(notification); } |