@Override public ResolveInfo resolveService(final Intent intent, final int flags) {
		final int original_intent_flags = intent.getFlags();
		// Intent flags could only filter background receivers, we have to deal with services by ourselves.
		return mCondom.proceed(OutboundType.QUERY_SERVICES, intent, null, new CondomCore.WrappedValueProcedure<ResolveInfo>() {
			@Override public ResolveInfo proceed() {
				if (! mCondom.mExcludeBackgroundServices && mCondom.mOutboundJudge == null)
					return CondomPackageManager.super.resolveService(intent, flags);    // Shortcut for pass-through

				final List<ResolveInfo> candidates = CondomPackageManager.super.queryIntentServices(intent, flags);
				final Intent original_intent = intent.setFlags(original_intent_flags);    // Restore the intent flags early before getFirstMatch().
				return mCondom.filterCandidates(OutboundType.QUERY_SERVICES, original_intent, candidates, TAG, false);
			}
		});
	}
Condom wrapper of {@link PackageManager}

Created by Oasis on 2018/1/6.
library/src/main/java/com/oasisfeng/condom/CondomPackageManager.java