Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d095a89 authored by Jin Seok Park's avatar Jin Seok Park Committed by Automerger Merge Worker
Browse files

DO NOT MERGE: Rename temp file to use a valid image file extension am: bb6d3861

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12455083

Change-Id: I9d51a70a19d429c5a8491fdcf3084f826e0f8e28
parents 52a88df9 bb6d3861
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.CRC32;
@@ -2079,7 +2080,10 @@ public class ExifInterface {
        try {
            // Move the original file to temporary file.
            if (mFilename != null) {
                tempFile = new File(mFilename + ".tmp");
                String parent = originalFile.getParent();
                String name = originalFile.getName();
                String tempPrefix = UUID.randomUUID().toString() + "_";
                tempFile = new File(parent, tempPrefix + name);
                if (!originalFile.renameTo(tempFile)) {
                    throw new IOException("Couldn't rename to " + tempFile.getAbsolutePath());
                }