prefer the third party intents SIM over the default one

This commit is contained in:
tibbi 2020-05-02 20:23:09 +02:00
parent 91c33b5030
commit 1ddbe9a06c
1 changed files with 1 additions and 1 deletions

View File

@ -65,8 +65,8 @@ class DialerActivity : SimpleActivity() {
private fun getHandleToUse(callback: (PhoneAccountHandle) -> Unit) { private fun getHandleToUse(callback: (PhoneAccountHandle) -> Unit) {
val defaultHandle = telecomManager.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL) val defaultHandle = telecomManager.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL)
when { when {
intent.hasExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE) -> callback(intent.getParcelableExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE)!!)
defaultHandle != null -> callback(defaultHandle) defaultHandle != null -> callback(defaultHandle)
intent.hasExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE) -> callback(intent.getParcelableExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE))
else -> { else -> {
handlePermission(PERMISSION_READ_PHONE_STATE) { handlePermission(PERMISSION_READ_PHONE_STATE) {
if (it) { if (it) {