summaryrefslogtreecommitdiff
path: root/app/java/src/SettingsActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/java/src/SettingsActivity.java')
-rw-r--r--app/java/src/SettingsActivity.java33
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();