mirror of
https://github.com/etesync/android
synced 2025-02-10 22:52:56 +00:00
16 lines
462 B
Kotlin
16 lines
462 B
Kotlin
![]() |
package com.etesync.syncadapter.utils
|
||
|
|
||
|
import android.accounts.Account
|
||
|
import android.accounts.AccountManager
|
||
|
import android.os.Build
|
||
|
|
||
|
object AndroidCompat {
|
||
|
fun removeAccount(accountManager: AccountManager, account: Account) {
|
||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||
|
accountManager.removeAccountExplicitly(account)
|
||
|
} else {
|
||
|
accountManager.removeAccount(account, null, null)
|
||
|
}
|
||
|
}
|
||
|
}
|