Use cache folder for photos

This commit is contained in:
M66B 2019-08-03 13:44:56 +02:00
parent 68d03fac18
commit f20ebe1183
2 changed files with 6 additions and 6 deletions

View File

@ -940,7 +940,7 @@ public class FragmentCompose extends FragmentBase {
} }
private void onActionTakePhoto() { private void onActionTakePhoto() {
File dir = new File(getContext().getFilesDir(), "temporary"); File dir = new File(getContext().getCacheDir(), "photo");
if (!dir.exists()) if (!dir.exists())
dir.mkdir(); dir.mkdir();
File file = new File(dir, new Date().getTime() + ".jpg"); File file = new File(dir, new Date().getTime() + ".jpg");
@ -1857,8 +1857,8 @@ public class FragmentCompose extends FragmentBase {
db.attachment().setDownloaded(attachment.id, size); db.attachment().setDownloaded(attachment.id, size);
if ("eu.faircode.email".equals(uri.getAuthority())) { if ("eu.faircode.email".equals(uri.getAuthority())) {
// content://eu.faircode.email/temporary/nnn.jpg // content://eu.faircode.email/photo/nnn.jpg
File tmp = new File(context.getFilesDir(), uri.getPath()); File tmp = new File(context.getCacheDir(), uri.getPath());
Log.i("Deleting " + tmp); Log.i("Deleting " + tmp);
if (!tmp.delete()) if (!tmp.delete())
Log.w("Error deleting " + tmp); Log.w("Error deleting " + tmp);

View File

@ -6,7 +6,7 @@
<files-path <files-path
name="raw" name="raw"
path="raw" /> path="raw" />
<files-path <cache-path
name="temporary" name="photo"
path="temporary" /> path="photo" />
</paths> </paths>