summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java19
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/Utils.java5
2 files changed, 16 insertions, 8 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java b/main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java
index 48bae757..88c46e6e 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/GeneralSettings.java
@@ -70,6 +70,13 @@ public class GeneralSettings extends PreferenceFragment implements OnPreferenceC
devHacks.removePreference(useInternalFS);
}
+ /* Android P does not allow access to the file storage anymore */
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P)
+ {
+ Preference useInternalFileSelector = findPreference("useInternalFileSelector");
+ devHacks.removePreference(useInternalFileSelector);
+ }
+
mExtapp = new ExternalAppDatabase(getActivity());
Preference clearapi = findPreference("clearapi");
clearapi.setOnPreferenceClickListener(this);
@@ -133,15 +140,13 @@ public class GeneralSettings extends PreferenceFragment implements OnPreferenceC
ApplicationInfo app;
PackageManager pm = getActivity().getPackageManager();
- String applist=null;
+ StringBuilder applist = new StringBuilder();
for (String packagename : mExtapp.getExtAppList()) {
try {
app = pm.getApplicationInfo(packagename, 0);
- if (applist==null)
- applist = "";
- else
- applist += delim;
- applist+=app.loadLabel(pm);
+ if (applist.length() != 0)
+ applist.append(delim);
+ applist.append(app.loadLabel(pm));
} catch (NameNotFoundException e) {
// App not found. Remove it from the list
@@ -149,7 +154,7 @@ public class GeneralSettings extends PreferenceFragment implements OnPreferenceC
}
}
- return applist;
+ return applist.toString();
}
private boolean isTunModuleAvailable() {
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java
index 0fa89540..abdc45f5 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java
@@ -153,8 +153,11 @@ public class Utils {
public static boolean alwaysUseOldFileChooser(Context c)
{
- SharedPreferences prefs = Preferences.getDefaultSharedPreferences(c);
+ /* Android P does not allow access to the file storage anymore */
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P)
+ return false;
+ SharedPreferences prefs = Preferences.getDefaultSharedPreferences(c);
return prefs.getBoolean("useInternalFileSelector", false);
}