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

Commit 2a4848ad authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Revert "Don't use file ID of the removed photo"

This reverts commit a12ac6d6.

Change-Id: I086396189653f5dd9f16ebd312d18631cae670d2
parent a12ac6d6
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -240,9 +240,7 @@ public class EditorUiUtils {
    /** Returns the {@link Photo#PHOTO_FILE_ID} from the given ValuesDelta. */
    /** Returns the {@link Photo#PHOTO_FILE_ID} from the given ValuesDelta. */
    public static Long getPhotoFileId(ValuesDelta valuesDelta) {
    public static Long getPhotoFileId(ValuesDelta valuesDelta) {
        if (valuesDelta == null) return null;
        if (valuesDelta == null) return null;
        // 1. There's no "after", we want to obtain the value of Photo.PHOTO_FILE_ID from "before".
        if (valuesDelta.getAfter() == null || valuesDelta.getAfter().get(Photo.PHOTO) == null) {
        // 2. There's a "after", we want to obtain the value of Photo.PHOTO_FILE_ID from "after".
        if (valuesDelta.getAfter().size() == 0 || valuesDelta.getAfter().get(Photo.PHOTO) != null) {
            return valuesDelta.getAsLong(Photo.PHOTO_FILE_ID);
            return valuesDelta.getAsLong(Photo.PHOTO_FILE_ID);
        }
        }
        return null;
        return null;