CustomTabDelegateFactory.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:chromium-for-android-56-debug-video 作者:
/**
 * Resolve the default external handler of an intent.
 * @return Whether the default external handler is found: if chrome turns out to be the
 *         default handler, this method will return false.
 */
private boolean hasDefaultHandler(Intent intent) {
    try {
        ResolveInfo info =
                mApplicationContext.getPackageManager().resolveActivity(intent, 0);
        if (info != null) {
            final String chromePackage = mApplicationContext.getPackageName();
            // If a default handler is found and it is not chrome itself, fire the intent.
            if (info.match != 0 && !chromePackage.equals(info.activityInfo.packageName)) {
                return true;
            }
        }
    } catch (RuntimeException e) {
        IntentUtils.logTransactionTooLargeOrRethrow(e, intent);
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号