summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorWenyi Wang <wenyiw@google.com>2016-02-17 22:02:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-02-17 22:02:29 +0000
commitcf0734b567b77bab782c533214ebe4e044a04f9c (patch)
treebad456146c22f4cdd010510478f7068597a312df /src/com/android
parent504f8e54d352b688623b4bf09c22a75ca5a8009e (diff)
parenta12ac6d6b376d5151d86a9d66c887a60fb604995 (diff)
downloadandroid_packages_apps_Contacts-cf0734b567b77bab782c533214ebe4e044a04f9c.tar.gz
android_packages_apps_Contacts-cf0734b567b77bab782c533214ebe4e044a04f9c.tar.bz2
android_packages_apps_Contacts-cf0734b567b77bab782c533214ebe4e044a04f9c.zip
Merge "Don't use file ID of the removed photo" into nyc-dev
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/contacts/editor/EditorUiUtils.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/contacts/editor/EditorUiUtils.java b/src/com/android/contacts/editor/EditorUiUtils.java
index a513be582..b87d4f4ab 100644
--- a/src/com/android/contacts/editor/EditorUiUtils.java
+++ b/src/com/android/contacts/editor/EditorUiUtils.java
@@ -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;