summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/fragments/GeneralSettings.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/blinkt/openvpn/fragments/GeneralSettings.java')
-rw-r--r--src/de/blinkt/openvpn/fragments/GeneralSettings.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/fragments/GeneralSettings.java b/src/de/blinkt/openvpn/fragments/GeneralSettings.java
new file mode 100644
index 00000000..4ac0a8ac
--- /dev/null
+++ b/src/de/blinkt/openvpn/fragments/GeneralSettings.java
@@ -0,0 +1,31 @@
+package de.blinkt.openvpn.fragments;
+import java.io.File;
+
+import android.os.Bundle;
+import android.preference.Preference;
+import android.preference.PreferenceFragment;
+import de.blinkt.openvpn.R;
+
+public class GeneralSettings extends PreferenceFragment {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+
+ // Load the preferences from an XML resource
+ addPreferencesFromResource(R.xml.general_settings);
+ Preference loadtun = findPreference("loadTunModule");
+ if(!isTunModuleAvailable())
+ loadtun.setEnabled(false);
+ }
+
+ private boolean isTunModuleAvailable() {
+ // Check if the tun module exists on the file system
+ if(new File("/system/lib/modules/tun.ko").length() > 10)
+ return true;
+ return false;
+ }
+
+
+ } \ No newline at end of file