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