fix #630, ask for CALL_PHONE permission at initiating WhatsApp calls

This commit is contained in:
tibbi 2022-02-07 16:19:29 +01:00
parent bf0c11016f
commit f00c333e87
2 changed files with 9 additions and 1 deletions

View File

@ -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'

View File

@ -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) {