mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-04-12 09:11:00 +02:00
fix #111, just dial the phone number if Phone permission is not granted
This commit is contained in:
parent
6695bf4f77
commit
d3c87e241c
@ -20,8 +20,8 @@ import java.io.File
|
|||||||
|
|
||||||
fun SimpleActivity.startCallIntent(recipient: String) {
|
fun SimpleActivity.startCallIntent(recipient: String) {
|
||||||
handlePermission(PERMISSION_CALL_PHONE) {
|
handlePermission(PERMISSION_CALL_PHONE) {
|
||||||
if (it) {
|
val action = if (it) Intent.ACTION_CALL else Intent.ACTION_DIAL
|
||||||
Intent(Intent.ACTION_CALL).apply {
|
Intent(action).apply {
|
||||||
data = Uri.fromParts("tel", recipient, null)
|
data = Uri.fromParts("tel", recipient, null)
|
||||||
if (resolveActivity(packageManager) != null) {
|
if (resolveActivity(packageManager) != null) {
|
||||||
startActivity(this)
|
startActivity(this)
|
||||||
@ -31,7 +31,6 @@ fun SimpleActivity.startCallIntent(recipient: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fun SimpleActivity.tryStartCall(contact: Contact) {
|
fun SimpleActivity.tryStartCall(contact: Contact) {
|
||||||
val numbers = contact.phoneNumbers
|
val numbers = contact.phoneNumbers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user