diff --git a/vector/src/main/java/im/vector/riotx/core/utils/ExternalApplicationsUtil.kt b/vector/src/main/java/im/vector/riotx/core/utils/ExternalApplicationsUtil.kt index 788e95a979..81be9620d0 100644 --- a/vector/src/main/java/im/vector/riotx/core/utils/ExternalApplicationsUtil.kt +++ b/vector/src/main/java/im/vector/riotx/core/utils/ExternalApplicationsUtil.kt @@ -70,6 +70,8 @@ fun openUrlInExternalBrowser(context: Context, uri: Uri?) { /** * Open url in custom tab or, if not available, in the default browser + * If several compatible browsers are installed, the user will be proposed to choose one. + * Ref: https://developer.chrome.com/multidevice/android/customtabs */ fun openUrlInChromeCustomTab(context: Context, session: CustomTabsSession?, url: String) { try { diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginSignUpSignInSsoFragment.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginSignUpSignInSsoFragment.kt index 10d96a317d..538e8be675 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginSignUpSignInSsoFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginSignUpSignInSsoFragment.kt @@ -43,6 +43,7 @@ open class LoginSignUpSignInSsoFragment @Inject constructor() : LoginSignUpSignI val packageName = CustomTabsClient.getPackageName(requireContext(), null) + // packageName can be null if there are 0 or several CustomTabs compatible browsers installed on the device if (packageName != null) { customTabsServiceConnection = object : CustomTabsServiceConnection() { override fun onCustomTabsServiceConnected(name: ComponentName, client: CustomTabsClient) {