0
0
mirror of https://github.com/etesync/android.git synced 2024-09-20 21:13:05 +02:00

Fix account and collection deletion on some devices.

Fixes #55
This commit is contained in:
Tom Hacohen 2019-01-06 20:59:06 +00:00
parent 2867d1564c
commit 93f0e17144

View File

@ -192,9 +192,11 @@ class LocalAddressBook(
fun delete() {
val accountManager = AccountManager.get(context)
@Suppress("DEPRECATION")
@TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
if (Build.VERSION.SDK_INT >= 22)
accountManager.removeAccount(account, null, null, null)
accountManager.removeAccountExplicitly(account)
else
accountManager.removeAccount(account, null, null)
}