mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 06:15:12 +00:00
avoid Security Exeception from AccountManager
This commit is contained in:
parent
5b6fd3759f
commit
6e885af18c
@ -86,7 +86,9 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
}
|
||||
}
|
||||
|
||||
if(AccountManager.get(context).getAccountsByType(ACCOUNT_TYPE).isEmpty()){
|
||||
AccountManager.get(context).addAccountExplicitly(Account(ACCOUNT_NAME, ACCOUNT_TYPE), "", null)
|
||||
}
|
||||
|
||||
// collect all contacts with phone number
|
||||
val contactsWithNumbers = collectPhoneNumbers()
|
||||
@ -319,9 +321,9 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
try {
|
||||
context.contentResolver.applyBatch(ContactsContract.AUTHORITY, ops)
|
||||
} catch (e: OperationApplicationException) {
|
||||
e.printStackTrace()
|
||||
Log.e(javaClass.simpleName, "", e)
|
||||
} catch (e: RemoteException) {
|
||||
e.printStackTrace()
|
||||
Log.e(javaClass.simpleName, "", e)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user