use of org.robolectric.manifest.PackageItemData in project robolectric by robolectric.
the class DefaultPackageManager method getReceiverInfo.
@Override
public ActivityInfo getReceiverInfo(ComponentName className, int flags) throws NameNotFoundException {
String packageName = className.getPackageName();
AndroidManifest androidManifest = androidManifests.get(packageName);
String classString = resolvePackageName(packageName, className);
for (PackageItemData receiver : androidManifest.getBroadcastReceivers()) {
if (receiver.getClassName().equals(classString)) {
ActivityInfo activityInfo = new ActivityInfo();
activityInfo.packageName = packageName;
activityInfo.name = classString;
if ((flags & GET_META_DATA) != 0) {
activityInfo.metaData = metaDataToBundle(receiver.getMetaData().getValueMap());
}
return activityInfo;
}
}
return null;
}
Aggregations