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) {
|
||||
handlePermission(PERMISSION_CALL_PHONE) {
|
||||
if (it) {
|
||||
Intent(Intent.ACTION_CALL).apply {
|
||||
val action = if (it) Intent.ACTION_CALL else Intent.ACTION_DIAL
|
||||
Intent(action).apply {
|
||||
data = Uri.fromParts("tel", recipient, null)
|
||||
if (resolveActivity(packageManager) != null) {
|
||||
startActivity(this)
|
||||
|
@ -30,7 +30,6 @@ fun SimpleActivity.startCallIntent(recipient: String) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun SimpleActivity.tryStartCall(contact: Contact) {
|
||||
|
|
Loading…
Reference in New Issue