diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/de/blinkt/openvpn/core/OpenVpnService.java | 4 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/fragments/GeneralSettings.java | 22 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/de/blinkt/openvpn/core/OpenVpnService.java b/src/de/blinkt/openvpn/core/OpenVpnService.java index 92e44e53..e4437d2c 100644 --- a/src/de/blinkt/openvpn/core/OpenVpnService.java +++ b/src/de/blinkt/openvpn/core/OpenVpnService.java @@ -480,7 +480,9 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac } catch (Exception e) { VpnStatus.logError(R.string.tun_open_error); VpnStatus.logError(getString(R.string.error) + e.getLocalizedMessage()); - VpnStatus.logError(R.string.tun_error_helpful); + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR1) { + VpnStatus.logError(R.string.tun_error_helpful); + } return null; } diff --git a/src/de/blinkt/openvpn/fragments/GeneralSettings.java b/src/de/blinkt/openvpn/fragments/GeneralSettings.java index a78c31f6..2e486dfe 100644 --- a/src/de/blinkt/openvpn/fragments/GeneralSettings.java +++ b/src/de/blinkt/openvpn/fragments/GeneralSettings.java @@ -9,9 +9,12 @@ import android.content.DialogInterface.OnClickListener; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; +import android.os.Build; import android.os.Bundle; +import android.preference.CheckBoxPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; +import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import de.blinkt.openvpn.R; import de.blinkt.openvpn.api.ExternalAppDatabase; @@ -28,14 +31,29 @@ public class GeneralSettings extends PreferenceFragment implements OnPreferenceC // Load the preferences from an XML resource addPreferencesFromResource(R.xml.general_settings); - Preference loadtun = findPreference("loadTunModule"); - if(!isTunModuleAvailable()) + + PreferenceCategory devHacks = (PreferenceCategory) findPreference("device_hacks"); + + + Preference loadtun = findPreference("loadTunModule"); + if(!isTunModuleAvailable()) { loadtun.setEnabled(false); + devHacks.removePreference(loadtun); + } + + CheckBoxPreference cm9hack = (CheckBoxPreference) findPreference("useCM9Fix"); + if (!cm9hack.isChecked() && (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR1)) { + devHacks.removePreference(cm9hack); + } mExtapp = new ExternalAppDatabase(getActivity()); Preference clearapi = findPreference("clearapi"); clearapi.setOnPreferenceClickListener(this); + + if(devHacks.getPreferenceCount()==0) + getPreferenceScreen().removePreference(devHacks); + setClearApiSummary(); } |