mirror of
				https://github.com/SimpleMobileTools/Simple-Contacts.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	moving the Launch ACTION_CALL intent handling in Commons
This commit is contained in:
		| @@ -57,7 +57,7 @@ android { | ||||
| } | ||||
|  | ||||
| dependencies { | ||||
|     implementation 'com.simplemobiletools:commons:5.27.17' | ||||
|     implementation 'com.simplemobiletools:commons:5.27.18' | ||||
|     implementation 'joda-time:joda-time:2.10.1' | ||||
|     implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5' | ||||
|     implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a' | ||||
|   | ||||
| @@ -9,7 +9,6 @@ import android.telecom.TelecomManager | ||||
| import com.simplemobiletools.commons.activities.BaseSimpleActivity | ||||
| import com.simplemobiletools.commons.dialogs.RadioGroupDialog | ||||
| import com.simplemobiletools.commons.extensions.* | ||||
| import com.simplemobiletools.commons.helpers.PERMISSION_CALL_PHONE | ||||
| import com.simplemobiletools.commons.helpers.PERMISSION_READ_PHONE_STATE | ||||
| import com.simplemobiletools.commons.models.RadioItem | ||||
| import com.simplemobiletools.contacts.pro.BuildConfig | ||||
| @@ -30,25 +29,6 @@ fun SimpleActivity.startCallIntent(recipient: String) { | ||||
|     } | ||||
| } | ||||
|  | ||||
| fun SimpleActivity.launchCallIntent(recipient: String, handle: PhoneAccountHandle?) { | ||||
|     handlePermission(PERMISSION_CALL_PHONE) { | ||||
|         val action = if (it) Intent.ACTION_CALL else Intent.ACTION_DIAL | ||||
|         Intent(action).apply { | ||||
|             data = Uri.fromParts("tel", recipient, null) | ||||
|  | ||||
|             if (handle != null) { | ||||
|                 putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, handle) | ||||
|             } | ||||
|  | ||||
|             if (resolveActivity(packageManager) != null) { | ||||
|                 startActivity(this) | ||||
|             } else { | ||||
|                 toast(R.string.no_app_found) | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| fun SimpleActivity.tryStartCall(contact: Contact) { | ||||
|     if (config.showCallConfirmation) { | ||||
|         CallConfirmationDialog(this, contact.getNameToDisplay()) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user