Bring back external attachment storage

This commit is contained in:
M66B
2023-12-20 13:00:29 +01:00
parent ee754dcace
commit 406486cc05
10 changed files with 146 additions and 16 deletions

View File

@@ -2659,6 +2659,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;