static boolean bindServiceViaShuttle(final Context context, final Intent service, final ShuttleServiceConnection conn, final int flags) {
		if (sPendingUnbind.remove(conn)) {		// Reuse the still connected service, which is pending disconnection.
			Log.d(TAG, "Reuse service: " + conn);
			sMainHandler.post(conn::callServiceConnected);
			return true;
		}

		final PackageManager pm = context.getPackageManager();
		final ResolveInfo resolve = pm.resolveService(service, PackageManager.GET_DISABLED_COMPONENTS);
		if (resolve == null) return false;		// Fail early by resolving the service intent before launching ServiceShuttleActivity.

		final Bundle extras = new Bundle();
		extras.putBinder(EXTRA_SERVICE_CONNECTION, conn.createDispatcher());
		final Intent intent = new Intent(ACTION_BIND_SERVICE).addFlags(SHUTTLE_ACTIVITY_START_FLAGS).putExtras(extras)
				.putExtra(EXTRA_INTENT, service).putExtra(EXTRA_FLAGS, flags);
		Log.d(TAG, "Connecting to service in profile (via shuttle): " + service + " from " + conn);
		if (sForwarderComponent == null) try {
			sForwarderComponent = pm.queryIntentActivities(intent, 0).stream()
					.filter(r -> (r.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)
					.map(r -> new ComponentName(r.activityInfo.packageName, r.activityInfo.name)).findFirst().orElse(null);
			if (sForwarderComponent == null) {
				Analytics.$().event("shuttle_service_forwarder_unavailable").send();
				return false;	// DO NOT fallback to default component assumed, due to cross-profile intent filter may not properly created.
			}
		} catch (final RuntimeException e) {
			Analytics.$().logAndReport(TAG, "Error querying " + intent, e);
		}
		if (sForwarderComponent == null)	// Last resort, assuming the default component unaltered.
			sForwarderComponent = new ComponentName("android", "com.android.internal.app.IntentForwarderActivity");

		intent.setComponent(sForwarderComponent);
		final Activity activity = Activities.findActivityFrom(context);
		try {
			if (activity != null) {
				activity.overridePendingTransition(0, 0);
				activity.startActivity(intent);
			} else context.startActivity(intent.addFlags(FLAG_ACTIVITY_NEW_TASK));
			return true;
		} catch (final ActivityNotFoundException e) {
			Analytics.$().logAndReport(TAG, "Error starting " + intent, e);
			return false;		// ServiceShuttle not ready in managed profile
		}
	}
Mechanism create binding from owner user to service in profile, via a proxy activity.
Created by Oasis on 2017/2/20.
shared/src/main/java/com/oasisfeng/island/shuttle/ServiceShuttle.java