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

Commit fcee1f26 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge branch '5455-master-duplicate_labels' into 'master'

AccountManager: synchronize creating groups and finding them

See merge request !46
parents cf776605 748b900c
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -310,9 +310,13 @@ class DavService: android.app.Service() {

                            // remember usable collections
                            if ((service.type == Service.TYPE_CARDDAV && info.type == Collection.TYPE_ADDRESSBOOK) ||
                                    (service.type == Service.TYPE_CALDAV && arrayOf(Collection.TYPE_CALENDAR, Collection.TYPE_WEBCAL).contains(info.type)))
                                    (service.type == Service.TYPE_CALDAV && arrayOf(Collection.TYPE_CALENDAR, Collection.TYPE_WEBCAL).contains(info.type))) {
                                // Ignore "recently contacted" accounts since it is buggy and causes error 501
                                if (!info.url.toString().contains(AccountSettings.CONTACTS_APP_INTERACTION)) {
                                    collections[response.href] = info
                                }
                            }
                        }
                    } catch(e: HttpException) {
                        if (e.code in arrayOf(403, 404, 410))
                            // delete home set only if it was not accessible (40x)
+1 −0
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ class LocalAddressBook(
     * @return id of the group with given title
     * @throws RemoteException on content provider errors
     */
    @Synchronized
    fun findOrCreateGroup(title: String): Long {
        provider!!.query(syncAdapterURI(Groups.CONTENT_URI), arrayOf(Groups._ID),
                "${Groups.TITLE}=?", arrayOf(title), null)?.use { cursor ->