private static boolean hasRedirectUriActivity()

in auth-lib/src/auth/java/com/spotify/sdk/android/auth/browser/CustomTabsSupportChecker.java [88:105]


    private static boolean hasRedirectUriActivity(PackageManager pm, String redirectUri) {
        if (pm == null) {
            return false;
        }
        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_VIEW);
        intent.addCategory(Intent.CATEGORY_DEFAULT);
        intent.addCategory(Intent.CATEGORY_BROWSABLE);
        intent.setData(Uri.parse(redirectUri));
        List<ResolveInfo> infoList = pm.queryIntentActivities(intent, PackageManager.GET_RESOLVED_FILTER);

        for (ResolveInfo info : infoList) {
            if (RedirectUriReceiverActivity.class.getName().equals(info.activityInfo.name)) {
                return true;
            }
        }
        return false;
    }