From f47c908c88875c32fd4c624aeecefbf660c17e85 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 19 May 2023 12:28:24 +0200 Subject: cleanup and comments --- app/java/src/DNSProxyService.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'app/java/src/DNSProxyService.java') 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); } -- cgit v1.2.3