Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de7ca7b9 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Basic implementation of calendar sync. with common SyncManager

parent fa4f090f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@ build/
# Ignore Gradle GUI config
gradle-app.setting


### external libs ###
.svn

# Javadoc
javadoc/
+3 −0
Original line number Diff line number Diff line
@@ -7,3 +7,6 @@
[submodule "MemorizingTrustManager"]
	path = MemorizingTrustManager
	url = https://github.com/ge0rg/MemorizingTrustManager
[submodule "ical4android"]
	path = ical4android
	url = git@gitlab.com:bitfireAT/ical4android.git
+2 −0
Original line number Diff line number Diff line
@@ -50,11 +50,13 @@ configurations.all {
}

dependencies {
    compile 'com.google.guava:guava:18.0'
    compile 'dnsjava:dnsjava:2.1.7'
    provided 'org.projectlombok:lombok:1.16.6'
    compile('org.slf4j:slf4j-android:1.7.12')

    compile project(':dav4android')
    compile project(':ical4android')
    compile project(':vcard4android')

    compile project(':MemorizingTrustManager')
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public class DavResourceFinder {
                                member.location.toString(),
                                displayName != null ? displayName.displayName : null,
                                description != null ? description.description : null,
                                color != null ? DavUtils.CalDAVtoARGBColor(color.color) : null
                                color != null ? color.color : null
                        );

                        CalendarTimezone tz = (CalendarTimezone)member.properties.get(CalendarTimezone.NAME);
+8 −3
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import lombok.Cleanup;
import lombok.Synchronized;


public class LocalAddressBook extends AndroidAddressBook {
public class LocalAddressBook extends AndroidAddressBook implements LocalCollection {

    protected static final String SYNC_STATE_CTAG = "ctag";

@@ -39,14 +39,15 @@ public class LocalAddressBook extends AndroidAddressBook {
    /**
     * Returns an array of local contacts, excluding those which have been modified locally (and not uploaded yet).
     */
    @Override
    public LocalContact[] getAll() throws ContactsStorageException {
        LocalContact contacts[] = (LocalContact[])queryContacts(null, null);
        return contacts;
        return (LocalContact[])queryContacts(null, null);
    }

    /**
     * Returns an array of local contacts which have been deleted locally. (DELETED != 0).
     */
    @Override
    public LocalContact[] getDeleted() throws ContactsStorageException {
        return (LocalContact[])queryContacts(ContactsContract.RawContacts.DELETED + "!=0", null);
    }
@@ -54,6 +55,7 @@ public class LocalAddressBook extends AndroidAddressBook {
    /**
     * Returns an array of local contacts which have been changed locally (DIRTY != 0).
     */
    @Override
    public LocalContact[] getDirty() throws ContactsStorageException {
        return (LocalContact[])queryContacts(ContactsContract.RawContacts.DIRTY + "!=0", null);
    }
@@ -61,6 +63,7 @@ public class LocalAddressBook extends AndroidAddressBook {
    /**
     * Returns an array of local contacts which don't have a file name yet.
     */
    @Override
    public LocalContact[] getWithoutFileName() throws ContactsStorageException {
        return (LocalContact[])queryContacts(AndroidContact.COLUMN_FILENAME + " IS NULL", null);
    }
@@ -77,6 +80,7 @@ public class LocalAddressBook extends AndroidAddressBook {
            syncState.clear();
    }

    @Override
    public String getCTag() throws ContactsStorageException {
        synchronized (syncState) {
            readSyncState();
@@ -84,6 +88,7 @@ public class LocalAddressBook extends AndroidAddressBook {
        }
    }

    @Override
    public void setCTag(String cTag) throws ContactsStorageException {
        synchronized (syncState) {
            readSyncState();
Loading