mirror of
https://github.com/etesync/android
synced 2025-01-22 21:51:04 +00:00
Version bump to 0.5.7
* use VCard ROLE as "department" and TITLE as "job title" * version bump to 0.5.7
This commit is contained in:
parent
9b992c54ca
commit
fee6431981
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="at.bitfire.davdroid"
|
||||
android:versionCode="24"
|
||||
android:versionName="0.5.6-alpha" android:installLocation="internalOnly">
|
||||
android:versionCode="25"
|
||||
android:versionName="0.5.7-alpha" android:installLocation="internalOnly">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="14"
|
||||
|
@ -12,7 +12,7 @@ package at.bitfire.davdroid;
|
||||
|
||||
public class Constants {
|
||||
public static final String
|
||||
APP_VERSION = "0.5.6-alpha",
|
||||
APP_VERSION = "0.5.7-alpha",
|
||||
|
||||
ACCOUNT_TYPE = "bitfire.at.davdroid",
|
||||
|
||||
|
@ -44,6 +44,7 @@ import ezvcard.property.Revision;
|
||||
import ezvcard.property.Role;
|
||||
import ezvcard.property.StructuredName;
|
||||
import ezvcard.property.Telephone;
|
||||
import ezvcard.property.Title;
|
||||
import ezvcard.property.Uid;
|
||||
import ezvcard.property.Url;
|
||||
|
||||
@ -73,7 +74,7 @@ public class Contact extends Resource {
|
||||
@Getter @Setter private String prefix, givenName, middleName, familyName, suffix;
|
||||
@Getter @Setter private String phoneticGivenName, phoneticMiddleName, phoneticFamilyName;
|
||||
@Getter @Setter private String note;
|
||||
@Getter @Setter private String organization, role;
|
||||
@Getter @Setter private String organization, jobTitle, department;
|
||||
|
||||
@Getter @Setter private byte[] photo;
|
||||
|
||||
@ -164,8 +165,14 @@ public class Contact extends Resource {
|
||||
if (!organizations.isEmpty())
|
||||
organization = organizations.get(0);
|
||||
}
|
||||
for (Role role : vcard.getRoles())
|
||||
this.role = role.getValue();
|
||||
for (Title title : vcard.getTitles()) {
|
||||
jobTitle = title.getValue();
|
||||
break;
|
||||
}
|
||||
for (Role role : vcard.getRoles()) {
|
||||
this.department = role.getValue();
|
||||
break;
|
||||
}
|
||||
|
||||
impps = vcard.getImpps();
|
||||
|
||||
@ -241,8 +248,10 @@ public class Contact extends Resource {
|
||||
org.addValue(organization);
|
||||
vcard.addOrganization(org);
|
||||
}
|
||||
if (role != null)
|
||||
vcard.addRole(role);
|
||||
if (jobTitle != null)
|
||||
vcard.addTitle(jobTitle);
|
||||
if (department != null)
|
||||
vcard.addRole(department);
|
||||
|
||||
for (Impp impp : impps)
|
||||
vcard.addImpp(impp);
|
||||
|
@ -312,16 +312,20 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
||||
}
|
||||
|
||||
protected void populateOrganization(Contact c) throws RemoteException {
|
||||
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Organization.COMPANY, Organization.TITLE },
|
||||
@Cleanup Cursor cursor = providerClient.query(dataURI(),
|
||||
new String[] { Organization.COMPANY, Organization.TITLE, Organization.DEPARTMENT },
|
||||
Photo.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||
new String[] { String.valueOf(c.getLocalID()), Organization.CONTENT_ITEM_TYPE }, null);
|
||||
if (cursor != null && cursor.moveToNext()) {
|
||||
String org = cursor.getString(0),
|
||||
role = cursor.getString(1);
|
||||
title = cursor.getString(1),
|
||||
department = cursor.getString(2);
|
||||
if (!StringUtils.isEmpty(org))
|
||||
c.setOrganization(org);
|
||||
if (!StringUtils.isEmpty(role))
|
||||
c.setRole(role);
|
||||
if (!StringUtils.isEmpty(title))
|
||||
c.setJobTitle(title);
|
||||
if (!StringUtils.isEmpty(department))
|
||||
c.setDepartment(department);
|
||||
}
|
||||
}
|
||||
|
||||
@ -520,8 +524,9 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
||||
if (contact.getPhoto() != null)
|
||||
queueOperation(buildPhoto(newDataInsertBuilder(localID, backrefIdx), contact.getPhoto()));
|
||||
|
||||
if (contact.getOrganization() != null || contact.getRole() != null)
|
||||
queueOperation(buildOrganization(newDataInsertBuilder(localID, backrefIdx), contact.getOrganization(), contact.getRole()));
|
||||
if (contact.getOrganization() != null || contact.getJobTitle() != null || contact.getDepartment() != null)
|
||||
queueOperation(buildOrganization(newDataInsertBuilder(localID, backrefIdx),
|
||||
contact.getOrganization(), contact.getJobTitle(), contact.getDepartment()));
|
||||
|
||||
for (Impp impp : contact.getImpps())
|
||||
queueOperation(buildIMPP(newDataInsertBuilder(localID, backrefIdx), impp));
|
||||
@ -683,11 +688,12 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
||||
.withValue(Photo.PHOTO, photo);
|
||||
}
|
||||
|
||||
protected Builder buildOrganization(Builder builder, String organization, String role) {
|
||||
protected Builder buildOrganization(Builder builder, String organization, String jobTitle, String department) {
|
||||
return builder
|
||||
.withValue(Data.MIMETYPE, Organization.CONTENT_ITEM_TYPE)
|
||||
.withValue(Organization.COMPANY, organization)
|
||||
.withValue(Organization.TITLE, role);
|
||||
.withValue(Organization.TITLE, jobTitle)
|
||||
.withValue(Organization.DEPARTMENT, department);
|
||||
}
|
||||
|
||||
protected Builder buildIMPP(Builder builder, Impp impp) {
|
||||
|
@ -64,7 +64,7 @@ public class SyncManager {
|
||||
}
|
||||
|
||||
if (!fetchCollection) {
|
||||
Log.i(TAG, "No local changes and CTags match, ne need to sync");
|
||||
Log.i(TAG, "No local changes and CTags match, no need to sync");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user