From f00c333e87fff737ab25225eb6ebb2b1ca4634a5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 7 Feb 2022 16:19:29 +0100 Subject: [PATCH] fix #630, ask for CALL_PHONE permission at initiating WhatsApp calls --- app/build.gradle | 2 +- .../contacts/pro/activities/ViewContactActivity.kt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 134f318c..d476bbc3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:02a57ef98a' + implementation 'com.github.SimpleMobileTools:Simple-Commons:d610f55603' implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.3' implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt index 85b2ebc8..58f7db14 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt @@ -707,6 +707,14 @@ class ViewContactActivity : ContactActivity() { flags = Intent.FLAG_ACTIVITY_CLEAR_TASK try { startActivity(this) + } catch (e: SecurityException) { + handlePermission(PERMISSION_CALL_PHONE) { success -> + if (success) { + startActivity(this) + } else { + toast(R.string.no_phone_call_permission) + } + } } catch (e: ActivityNotFoundException) { toast(R.string.no_app_found) } catch (e: Exception) {