Revert "ROOM temp dir"

This reverts commit aaafe78bef.
pull/214/head
M66B 11 months ago
parent a751f06242
commit 0f19f09751

@ -206,8 +206,8 @@ class SQLiteCopyOpenHelper implements SupportSQLiteOpenHelper, DelegatingOpenHel
// An intermediate file is used so that we never end up with a half-copied database file
// in the internal directory.
File dir = eu.faircode.email.Helper.ensureExists(new File(mContext.getFilesDir(), "shared"));
File intermediateFile = new File(dir,"room-copy-helper.tmp");
File intermediateFile = File.createTempFile(
"room-copy-helper", ".tmp", mContext.getCacheDir());
intermediateFile.deleteOnExit();
FileChannel output = new FileOutputStream(intermediateFile).getChannel();
FileUtil.copy(input, output);

@ -2633,7 +2633,7 @@ public class Helper {
private static final Map<File, Boolean> exists = new HashMap<>();
public static File ensureExists(File dir) {
static File ensureExists(File dir) {
synchronized (exists) {
if (exists.containsKey(dir))
return dir;

Loading…
Cancel
Save