Loading src/com/android/contacts/model/EntityModifier.java +6 −4 Original line number Diff line number Diff line Loading @@ -85,7 +85,10 @@ public class EntityModifier { if (!hasChild && kind != null) { // Create child when none exists and valid kind insertChild(state, kind); final ValuesDelta child = insertChild(state, kind); if (kind.mimeType.equals(Photo.CONTENT_ITEM_TYPE)) { child.setFromTemplate(true); } } } Loading Loading @@ -321,7 +324,6 @@ public class EntityModifier { public static ValuesDelta insertChild(EntityDelta state, DataKind kind, EditType type) { // Bail early if invalid kind if (kind == null) return null; final ContentValues after = new ContentValues(); // Our parent CONTACT_ID is provided later Loading Loading @@ -385,6 +387,7 @@ public class EntityModifier { state.getValues().getAsString(RawContacts.ACCOUNT_TYPE)); final boolean isPhoto = TextUtils.equals(Photo.CONTENT_ITEM_TYPE, kind.mimeType); final boolean isGooglePhoto = isPhoto && isGoogleSource; if (EntityModifier.isEmpty(entry, kind) && !isGooglePhoto) { // TODO: remove this verbose logging Log.w(TAG, "Trimming: " + entry.toString()); Loading @@ -394,7 +397,6 @@ public class EntityModifier { } } } if (!hasValues) { // Trim overall entity if no children exist state.markDeleted(); Loading src/com/android/contacts/ui/widget/PhotoEditorView.java +3 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public class PhotoEditorView extends ImageView implements Editor, OnClickListene setImageBitmap(photo); setEnabled(!readOnly); mHasSetPhoto = true; mEntry.setFromTemplate(false); } else { resetDefault(); } Loading Loading @@ -125,6 +126,7 @@ public class PhotoEditorView extends ImageView implements Editor, OnClickListene mEntry.put(Photo.PHOTO, out.toByteArray()); setImageBitmap(photo); mHasSetPhoto = true; mEntry.setFromTemplate(false); } catch (IOException e) { Log.w(TAG, "Unable to serialize photo: " + e.toString()); } Loading @@ -135,6 +137,7 @@ public class PhotoEditorView extends ImageView implements Editor, OnClickListene setScaleType(ImageView.ScaleType.CENTER); setImageResource(R.drawable.ic_menu_add_picture); mHasSetPhoto = false; mEntry.setFromTemplate(true); } /** {@inheritDoc} */ Loading Loading
src/com/android/contacts/model/EntityModifier.java +6 −4 Original line number Diff line number Diff line Loading @@ -85,7 +85,10 @@ public class EntityModifier { if (!hasChild && kind != null) { // Create child when none exists and valid kind insertChild(state, kind); final ValuesDelta child = insertChild(state, kind); if (kind.mimeType.equals(Photo.CONTENT_ITEM_TYPE)) { child.setFromTemplate(true); } } } Loading Loading @@ -321,7 +324,6 @@ public class EntityModifier { public static ValuesDelta insertChild(EntityDelta state, DataKind kind, EditType type) { // Bail early if invalid kind if (kind == null) return null; final ContentValues after = new ContentValues(); // Our parent CONTACT_ID is provided later Loading Loading @@ -385,6 +387,7 @@ public class EntityModifier { state.getValues().getAsString(RawContacts.ACCOUNT_TYPE)); final boolean isPhoto = TextUtils.equals(Photo.CONTENT_ITEM_TYPE, kind.mimeType); final boolean isGooglePhoto = isPhoto && isGoogleSource; if (EntityModifier.isEmpty(entry, kind) && !isGooglePhoto) { // TODO: remove this verbose logging Log.w(TAG, "Trimming: " + entry.toString()); Loading @@ -394,7 +397,6 @@ public class EntityModifier { } } } if (!hasValues) { // Trim overall entity if no children exist state.markDeleted(); Loading
src/com/android/contacts/ui/widget/PhotoEditorView.java +3 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public class PhotoEditorView extends ImageView implements Editor, OnClickListene setImageBitmap(photo); setEnabled(!readOnly); mHasSetPhoto = true; mEntry.setFromTemplate(false); } else { resetDefault(); } Loading Loading @@ -125,6 +126,7 @@ public class PhotoEditorView extends ImageView implements Editor, OnClickListene mEntry.put(Photo.PHOTO, out.toByteArray()); setImageBitmap(photo); mHasSetPhoto = true; mEntry.setFromTemplate(false); } catch (IOException e) { Log.w(TAG, "Unable to serialize photo: " + e.toString()); } Loading @@ -135,6 +137,7 @@ public class PhotoEditorView extends ImageView implements Editor, OnClickListene setScaleType(ImageView.ScaleType.CENTER); setImageResource(R.drawable.ic_menu_add_picture); mHasSetPhoto = false; mEntry.setFromTemplate(true); } /** {@inheritDoc} */ Loading