@CheckResult <T, E extends Throwable> List<T> proceedQuery(final OutboundType type, final @Nullable Intent intent,
															   final WrappedValueProcedureThrows<List<T>, E> procedure, final Function<T, String> pkg_getter) throws E {
		return proceed(type, intent, Collections.emptyList(), () -> {
			final List<T> candidates = procedure.proceed();

			if (candidates != null && mOutboundJudge != null && (intent == null || getTargetPackage(intent) == null)) {	// Package-targeted intent is already filtered by OutboundJudge in proceed().
				final Iterator<T> iterator = candidates.iterator();
				while (iterator.hasNext()) {
					final T candidate = iterator.next();
					final String pkg = pkg_getter.apply(candidate);
					if (pkg != null && shouldBlockRequestTarget(type, intent, pkg))		// Dry-run is checked inside shouldBlockRequestTarget()
						iterator.remove();		// TODO: Not safe to assume the list returned from PackageManager is modifiable.
				}
			}
			return candidates;
		});
	}
The shared functionality for condom wrappers.

Created by Oasis on 2017/4/21.
library/src/main/java/com/oasisfeng/condom/CondomCore.java