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

Commit cf0734b5 authored by Wenyi Wang's avatar Wenyi Wang Committed by Android (Google) Code Review
Browse files

Merge "Don't use file ID of the removed photo" into nyc-dev

parents 504f8e54 a12ac6d6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -240,7 +240,9 @@ public class EditorUiUtils {
    /** Returns the {@link Photo#PHOTO_FILE_ID} from the given ValuesDelta. */
    public static Long getPhotoFileId(ValuesDelta valuesDelta) {
        if (valuesDelta == null) return null;
        if (valuesDelta.getAfter() == null || valuesDelta.getAfter().get(Photo.PHOTO) == null) {
        // 1. There's no "after", we want to obtain the value of Photo.PHOTO_FILE_ID from "before".
        // 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 null;