Revert "ROOM temp dir"

This reverts commit aaafe78bef.
This commit is contained in:
M66B 2023-11-24 20:20:35 +01:00
parent a751f06242
commit 0f19f09751
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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;