Merge commit '82aaf28b63179bcf018eca816ad9b57d79a38079' * commit '82aaf28b63179bcf018eca816ad9b57d79a38079': Allow photo changes to be uploaded to Exchange (fixes #2179082)
This commit is contained in:
commit
e91a6d874d
@ -1628,6 +1628,15 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendPhoto(Serializer s, ContentValues cv) throws IOException {
|
||||||
|
if (cv.containsKey(Photo.PHOTO)) {
|
||||||
|
byte[] bytes = cv.getAsByteArray(Photo.PHOTO);
|
||||||
|
byte[] encodedBytes = Base64.encodeBase64(bytes);
|
||||||
|
String pic = new String(encodedBytes);
|
||||||
|
s.data(Tags.CONTACTS_PICTURE, pic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void sendOrganization(Serializer s, ContentValues cv) throws IOException {
|
private void sendOrganization(Serializer s, ContentValues cv) throws IOException {
|
||||||
if (cv.containsKey(Organization.TITLE)) {
|
if (cv.containsKey(Organization.TITLE)) {
|
||||||
s.data(Tags.CONTACTS_JOB_TITLE, cv.getAsString(Organization.TITLE));
|
s.data(Tags.CONTACTS_JOB_TITLE, cv.getAsString(Organization.TITLE));
|
||||||
@ -1854,8 +1863,7 @@ public class ContactsSyncAdapter extends AbstractSyncAdapter {
|
|||||||
} else if (mimeType.equals(Note.CONTENT_ITEM_TYPE)) {
|
} else if (mimeType.equals(Note.CONTENT_ITEM_TYPE)) {
|
||||||
sendNote(s, cv);
|
sendNote(s, cv);
|
||||||
} else if (mimeType.equals(Photo.CONTENT_ITEM_TYPE)) {
|
} else if (mimeType.equals(Photo.CONTENT_ITEM_TYPE)) {
|
||||||
// For now, the user can change the photo, but the change won't be
|
sendPhoto(s, cv);
|
||||||
// uploaded.
|
|
||||||
} else {
|
} else {
|
||||||
userLog("Contacts upsync, unknown data: ", mimeType);
|
userLog("Contacts upsync, unknown data: ", mimeType);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user