summaryrefslogtreecommitdiff
path: root/src/se/leap/openvpn/GeneralSettings.java
blob: 93e4818e3e3af5b188057ddee02fb30b4494978f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package se.leap.openvpn;
import java.io.File;

import se.leap.bitmaskclient.R;

import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;

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;
		}

	
	}