mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent trying to resolve native contact if permission hasn't been granted
This commit is contained in:
parent
cad1679399
commit
8e156c0b33
1 changed files with 8 additions and 6 deletions
|
|
@ -278,16 +278,18 @@ class MainActivity : GenericActivity(), SnackBarActivity, NavController.OnDestin
|
|||
}
|
||||
Intent.ACTION_VIEW -> {
|
||||
val uri = intent.data
|
||||
if (intent.type == AppUtils.getString(R.string.linphone_address_mime_type)) {
|
||||
if (uri != null) {
|
||||
val contactId = coreContext.contactsManager.getAndroidContactIdFromUri(uri)
|
||||
if (uri != null) {
|
||||
if (
|
||||
intent.type == AppUtils.getString(R.string.linphone_address_mime_type) &&
|
||||
PermissionHelper.get().hasReadContactsPermission()
|
||||
) {
|
||||
val contactId =
|
||||
coreContext.contactsManager.getAndroidContactIdFromUri(uri)
|
||||
if (contactId != null) {
|
||||
Log.i("[Main Activity] Found contact URI parameter in intent: $uri")
|
||||
navigateToContact(contactId)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (uri != null) {
|
||||
} else {
|
||||
handleTelOrSipUri(uri)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue