Loading app/src/main/java/foundation/e/accountmanager/settings/AccountSettings.kt +11 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,8 @@ class AccountSettings( const val SYNC_INTERVAL_MANUALLY = -1L const val CONTACTS_APP_INTERACTION = "z-app-generated--contactsinteraction--recent/" fun initialUserData(credentials: Credentials, baseURL: String?): Bundle { val bundle = Bundle(2) bundle.putString(KEY_SETTINGS_VERSION, CURRENT_VERSION.toString()) Loading Loading @@ -316,6 +318,15 @@ class AccountSettings( @Suppress("unused","FunctionName") private fun update_10_11() { setGroupMethod(GroupMethod.CATEGORIES) val db = AppDatabase.getInstance(context) val service = db.serviceDao().getByAccountAndType(account.name, Service.TYPE_CARDDAV) if (service != null) { for (collection in db.collectionDao().getByServiceAndSync(service.id)) { if(collection.url.toString().contains(CONTACTS_APP_INTERACTION)) { db.collectionDao().delete(collection) } } } } @Suppress("unused","FunctionName") Loading app/src/main/java/foundation/e/accountmanager/syncadapter/EeloAddressBooksSyncAdapterService.kt +5 −1 Original line number Diff line number Diff line Loading @@ -66,8 +66,12 @@ class EeloAddressBooksSyncAdapterService : SyncAdapterService() { val remoteAddressBooks = mutableMapOf<HttpUrl, Collection>() if (service != null) for (collection in db.collectionDao().getByServiceAndSync(service.id)) for (collection in db.collectionDao().getByServiceAndSync(service.id)) { if(collection.url.toString().contains(AccountSettings.CONTACTS_APP_INTERACTION)) { db.collectionDao().delete(collection) } remoteAddressBooks[collection.url] = collection } if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) != PackageManager.PERMISSION_GRANTED) { if (remoteAddressBooks.isEmpty()) Loading Loading
app/src/main/java/foundation/e/accountmanager/settings/AccountSettings.kt +11 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,8 @@ class AccountSettings( const val SYNC_INTERVAL_MANUALLY = -1L const val CONTACTS_APP_INTERACTION = "z-app-generated--contactsinteraction--recent/" fun initialUserData(credentials: Credentials, baseURL: String?): Bundle { val bundle = Bundle(2) bundle.putString(KEY_SETTINGS_VERSION, CURRENT_VERSION.toString()) Loading Loading @@ -316,6 +318,15 @@ class AccountSettings( @Suppress("unused","FunctionName") private fun update_10_11() { setGroupMethod(GroupMethod.CATEGORIES) val db = AppDatabase.getInstance(context) val service = db.serviceDao().getByAccountAndType(account.name, Service.TYPE_CARDDAV) if (service != null) { for (collection in db.collectionDao().getByServiceAndSync(service.id)) { if(collection.url.toString().contains(CONTACTS_APP_INTERACTION)) { db.collectionDao().delete(collection) } } } } @Suppress("unused","FunctionName") Loading
app/src/main/java/foundation/e/accountmanager/syncadapter/EeloAddressBooksSyncAdapterService.kt +5 −1 Original line number Diff line number Diff line Loading @@ -66,8 +66,12 @@ class EeloAddressBooksSyncAdapterService : SyncAdapterService() { val remoteAddressBooks = mutableMapOf<HttpUrl, Collection>() if (service != null) for (collection in db.collectionDao().getByServiceAndSync(service.id)) for (collection in db.collectionDao().getByServiceAndSync(service.id)) { if(collection.url.toString().contains(AccountSettings.CONTACTS_APP_INTERACTION)) { db.collectionDao().delete(collection) } remoteAddressBooks[collection.url] = collection } if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) != PackageManager.PERMISSION_GRANTED) { if (remoteAddressBooks.isEmpty()) Loading