/** * Adds extra resolve info for an intent. * * <p>Note that this resolve info will have {@link ResolveInfo#isDefault} field set to {@code * true} to allow its resolution for implicit intents. If this is not what you want, then please * use {@link #addResolveInfoForIntentNoDefaults} instead. */ public void addResolveInfoForIntent(Intent intent, ResolveInfo info) { info.isDefault = true; ComponentInfo[] componentInfos = new ComponentInfo[] { info.activityInfo, info.serviceInfo, Build.VERSION.SDK_INT >= KITKAT ? info.providerInfo : null }; for (ComponentInfo component : componentInfos) { if (component != null && component.applicationInfo != null) { component.applicationInfo.flags |= ApplicationInfo.FLAG_INSTALLED; } } addResolveInfoForIntentNoDefaults(intent, info); }