summaryrefslogtreecommitdiff
path: root/app/java/src/WifiListenerReceiver.java
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-05-19 12:28:24 +0200
committerDaniel Weipert <code@drogueronin.de>2023-05-19 12:28:24 +0200
commitf47c908c88875c32fd4c624aeecefbf660c17e85 (patch)
tree659fd0d6a854d9af06275172e21a8e9e9fc8cc65 /app/java/src/WifiListenerReceiver.java
parent309993eec6085cfa0e112cd5f45c8c55beeee5db (diff)
cleanup and comments
Diffstat (limited to 'app/java/src/WifiListenerReceiver.java')
-rw-r--r--app/java/src/WifiListenerReceiver.java11
1 files changed, 1 insertions, 10 deletions
diff --git a/app/java/src/WifiListenerReceiver.java b/app/java/src/WifiListenerReceiver.java
index 6bf93bd..5e05654 100644
--- a/app/java/src/WifiListenerReceiver.java
+++ b/app/java/src/WifiListenerReceiver.java
@@ -1,7 +1,5 @@
package org.pihole.dnsproxy;
-import android.provider.Settings;
-
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -9,9 +7,7 @@ import android.content.SharedPreferences;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
-import android.net.wifi.WifiInfo;
-import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
@@ -37,12 +33,7 @@ public class WifiListenerReceiver extends BroadcastReceiver
(new Handler()).postDelayed(new Runnable() {
@Override
public void run() {
- WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
- WifiInfo wifiInfo = wifiManager.getConnectionInfo();
- String ssid = wifiInfo.getSSID();
-
- // remove quotes around ssid
- ssid = ssid.substring(1, ssid.length() - 1);
+ String ssid = WifiListenerService.getWifiSSID(context);
if (ssid.equals(sharedPreferences.getString("wifi_listener_ssid", ""))) {
DNSProxyService.start(context);