mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 06:08:31 +02:00
getExternalFilesDir compat
This commit is contained in:
@@ -2275,6 +2275,18 @@ public class Helper {
|
||||
return dir;
|
||||
}
|
||||
|
||||
static File getExternalFilesDir(Context context) {
|
||||
return getExternalFilesDir(context, null);
|
||||
}
|
||||
|
||||
static File getExternalFilesDir(Context context, String type) {
|
||||
File[] dirs = ContextCompat.getExternalFilesDirs(context, type);
|
||||
if (dirs == null || dirs.length == 0)
|
||||
return context.getExternalFilesDir(type);
|
||||
else
|
||||
return dirs[0];
|
||||
}
|
||||
|
||||
static String sanitizeFilename(String name) {
|
||||
if (name == null)
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user