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/SettingsActivity.java | |
parent | 309993eec6085cfa0e112cd5f45c8c55beeee5db (diff) |
cleanup and comments
Diffstat (limited to 'app/java/src/SettingsActivity.java')
-rw-r--r-- | app/java/src/SettingsActivity.java | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/app/java/src/SettingsActivity.java b/app/java/src/SettingsActivity.java index d04e2ba..0b3c7f2 100644 --- a/app/java/src/SettingsActivity.java +++ b/app/java/src/SettingsActivity.java @@ -1,43 +1,17 @@ package org.pihole.dnsproxy; -import android.app.Activity; -import android.app.AlertDialog; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; -import android.net.VpnService; -import android.net.wifi.WifiManager; -import android.net.wifi.WifiInfo; - import android.os.Bundle; -import android.preference.MultiSelectListPreference; import android.preference.PreferenceActivity; import android.preference.PreferenceFragment; import android.util.Log; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.TextureView; -import android.view.View; - -import android.widget.Button; -import android.widget.Toast; -import android.provider.Settings; - -import java.util.List; - public class SettingsActivity extends PreferenceActivity { - private MultiSelectListPreference knownSsids; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -135,12 +109,7 @@ public class SettingsActivity extends PreferenceActivity { WifiListenerService.OnActivationListener.askLocationIfNeeded(context.getActivity()); if (sharedPreferences.getString("wifi_listener_ssid", "").equals("")) { - WifiManager wifiManager = (WifiManager) context.getActivity().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.getActivity()); if (!ssid.equals("unknown ssid")) { SharedPreferences.Editor sharedPreferencesEditor = sharedPreferences.edit(); |