public static @Nullable ComponentName getFileProviderComponent(final Context context) {
		if (sFileProviderComponent != null) return sFileProviderComponent.getPackageName().isEmpty() ? null : sFileProviderComponent;
		final String my_pkg = context.getPackageName();
		final Intent intent = new Intent(DocumentsContract.PROVIDER_INTERFACE).setPackage(my_pkg);		// First query in current package
		final PackageManager pm = context.getPackageManager();
		List<ResolveInfo> resolves = pm.queryIntentContentProviders(intent, MATCH_DISABLED_COMPONENTS);
		if (! resolves.isEmpty()) {
			if (resolves.size() > 1) throw new IllegalStateException("More than 1 file provider: " + resolves);
			return sFileProviderComponent = new ComponentName(my_pkg, resolves.get(0).providerInfo.name);
		}
		resolves = pm.queryIntentContentProviders(intent.setPackage(null), MATCH_DISABLED_COMPONENTS);	// Query in UID-shared packages
		final int my_uid = Process.myUid();
		for (final ResolveInfo resolve : resolves) {
			final ProviderInfo provider = resolve.providerInfo;
			if (provider.applicationInfo.uid != my_uid) continue;
			return sFileProviderComponent = new ComponentName(provider.packageName, provider.name);
		}
		sFileProviderComponent = new ComponentName("", "");
		return null;
	}
Utility class to get module ID of common modules in Island.

Created by Oasis on 2017/2/19.
shared/src/main/java/com/oasisfeng/island/util/Modules.java