mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 14:46:31 +02:00
Removed external attachment storage
This commit is contained in:
@@ -172,7 +172,7 @@ public class EntityAttachment {
|
||||
}
|
||||
|
||||
static File getFile(Context context, long id, String name) {
|
||||
File dir = Helper.ensureExists(new File(getRoot(context), "attachments"));
|
||||
File dir = Helper.ensureExists(new File(context.getFilesDir(), "attachments"));
|
||||
String filename = Long.toString(id);
|
||||
if (!TextUtils.isEmpty(name))
|
||||
filename += "." + Helper.sanitizeFilename(name);
|
||||
@@ -181,16 +181,6 @@ public class EntityAttachment {
|
||||
return new File(dir, filename);
|
||||
}
|
||||
|
||||
static File getRoot(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean external_storage = prefs.getBoolean("external_storage", false);
|
||||
|
||||
File root = (external_storage
|
||||
? Helper.getExternalFilesDir(context)
|
||||
: context.getFilesDir());
|
||||
return root;
|
||||
}
|
||||
|
||||
static void copy(Context context, long oldid, long newid) {
|
||||
DB db = DB.getInstance(context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user