summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-07 21:45:11 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-07 21:46:41 -0600
commit38b2aafce8f5fcaeadd3a7e970f41345243a2b56 (patch)
tree50fb3efb218c3c81de812ecee7bdaf9427b018bd
parent16c0b5b15add29744e1e9d22c09a040632842dae (diff)
Remove primary configuration preference
It is no longer used. Signed-off-by: Samuel Holland <samuel@sholland.org>
-rw-r--r--app/src/main/java/com/wireguard/android/activity/SettingsActivity.java10
-rw-r--r--app/src/main/java/com/wireguard/android/preference/TunnelListPreference.java45
-rw-r--r--app/src/main/res/values/strings.xml2
-rw-r--r--app/src/main/res/xml/preferences.xml4
4 files changed, 1 insertions, 60 deletions
diff --git a/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java b/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java
index c6c69789..06d40ad5 100644
--- a/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java
+++ b/app/src/main/java/com/wireguard/android/activity/SettingsActivity.java
@@ -1,7 +1,6 @@
package com.wireguard.android.activity;
import android.app.Activity;
-import android.app.Fragment;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -9,7 +8,6 @@ import android.preference.Preference;
import android.preference.PreferenceFragment;
import com.wireguard.android.R;
-import com.wireguard.android.preference.TunnelListPreference;
import com.wireguard.android.util.RootShell;
/**
@@ -17,16 +15,12 @@ import com.wireguard.android.util.RootShell;
*/
public class SettingsActivity extends Activity {
- public static final String KEY_SHOW_QUICK_TILE_SETTINGS = "show_quick_tile_settings";
-
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getFragmentManager().findFragmentById(android.R.id.content) == null) {
- final Fragment fragment = new SettingsFragment();
- fragment.setArguments(getIntent().getExtras());
getFragmentManager().beginTransaction()
- .add(android.R.id.content, fragment)
+ .add(android.R.id.content, new SettingsFragment())
.commit();
}
}
@@ -41,8 +35,6 @@ public class SettingsActivity extends Activity {
new ToolsInstaller(preference).execute();
return true;
});
- if (getArguments() != null && getArguments().getBoolean(KEY_SHOW_QUICK_TILE_SETTINGS))
- ((TunnelListPreference) findPreference("primary_config")).show();
}
}
diff --git a/app/src/main/java/com/wireguard/android/preference/TunnelListPreference.java b/app/src/main/java/com/wireguard/android/preference/TunnelListPreference.java
deleted file mode 100644
index eefd9912..00000000
--- a/app/src/main/java/com/wireguard/android/preference/TunnelListPreference.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.wireguard.android.preference;
-
-import android.content.Context;
-import android.preference.ListPreference;
-import android.util.AttributeSet;
-
-import com.wireguard.android.Application;
-import com.wireguard.android.model.Tunnel;
-import com.wireguard.android.model.TunnelManager;
-
-import java9.util.stream.StreamSupport;
-
-/**
- * ListPreference that is automatically filled with the list of tunnels.
- */
-
-public class TunnelListPreference extends ListPreference {
- public TunnelListPreference(final Context context, final AttributeSet attrs,
- final int defStyleAttr, final int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- final TunnelManager tunnelManager = Application.getComponent().getTunnelManager();
- final CharSequence[] entries = StreamSupport.stream(tunnelManager.getTunnels())
- .map(Tunnel::getName)
- .toArray(String[]::new);
- setEntries(entries);
- setEntryValues(entries);
- }
-
- public TunnelListPreference(final Context context, final AttributeSet attrs,
- final int defStyleAttr) {
- this(context, attrs, defStyleAttr, 0);
- }
-
- public TunnelListPreference(final Context context, final AttributeSet attrs) {
- this(context, attrs, android.R.attr.dialogPreferenceStyle);
- }
-
- public TunnelListPreference(final Context context) {
- this(context, null);
- }
-
- public void show() {
- showDialog(null);
- }
-}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 52b7de60..c897e345 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -52,8 +52,6 @@
<string name="persistent_keepalive">Persistent keepalive</string>
<string name="placeholder_text">No configuration selected</string>
<string name="pre_shared_key">Pre-shared key</string>
- <string name="primary_config">Quick tile configuration</string>
- <string name="primary_config_summary">This configuration will be controlled by the quick settings tile</string>
<string name="private_key">Private key</string>
<string name="public_key">Public key</string>
<string name="public_key_copied_message">Public key copied to clipboard</string>
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 1693839b..e02572dd 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <com.wireguard.android.preference.TunnelListPreference
- android:key="primary_config"
- android:summary="@string/primary_config_summary"
- android:title="@string/primary_config" />
<CheckBoxPreference
android:defaultValue="false"
android:key="restore_on_boot"