Commit 49dd92aa authored by Abhishek Aggarwal's avatar Abhishek Aggarwal
Browse files

AccountManager: synchronize creating groups and finding them

 * also remove usecase where "recently contacted" was shown for breif period of time
parent cf776605
Pipeline #186588 passed with stage
in 5 minutes and 58 seconds
......@@ -310,8 +310,11 @@ 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)))
collections[response.href] = info
(service.type == Service.TYPE_CALDAV && arrayOf(Collection.TYPE_CALENDAR, Collection.TYPE_WEBCAL).contains(info.type))) {
if (!info.url.toString().contains(AccountSettings.CONTACTS_APP_INTERACTION)) {
collections[response.href] = info
}
}
}
} catch(e: HttpException) {
if (e.code in arrayOf(403, 404, 410))
......
......@@ -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 ->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment