List of usage examples for android.content.pm ActivityInfo loadXmlMetaData
public XmlResourceParser loadXmlMetaData(PackageManager pm, String name)
From source file:com.anysoftkeyboard.addons.AddOnsFactory.java
private List<E> getAddOnsFromActivityInfo(Context packContext, ActivityInfo ai) { final XmlPullParser xml = ai.loadXmlMetaData(mContext.getPackageManager(), mReceiverMetaData); if (xml == null)//issue 718: maybe a bad package? return new ArrayList<>(); return parseAddOnsFromXml(packContext, xml); }
From source file:com.anysoftkeyboard.addons.AddOnsFactory.java
private boolean isPackageContainAnAddon(String packageNameSchemePart) throws NameNotFoundException { PackageInfo newPackage = mContext.getPackageManager().getPackageInfo(packageNameSchemePart, PackageManager.GET_RECEIVERS + PackageManager.GET_META_DATA); if (newPackage.receivers != null) { ActivityInfo[] receivers = newPackage.receivers; for (ActivityInfo aReceiver : receivers) { //issue 904 if (aReceiver == null || aReceiver.applicationInfo == null || !aReceiver.enabled || !aReceiver.applicationInfo.enabled) continue; final XmlPullParser xml = aReceiver.loadXmlMetaData(mContext.getPackageManager(), mReceiverMetaData);/*from ww w . j a va 2 s.c om*/ if (xml != null) { return true; } } } return false; }