@Override public boolean bindService(final Intent service, final ServiceConnection connection, final int flags) {
		final UserHandle profile = Users.profile;
		if (profile == null) return false;
		if (! ALWAYS_USE_ACTIVITY_SHUTTLE && Permissions.has(this, Permissions.INTERACT_ACROSS_USERS)) try {
			if (Hacks.Context_bindServiceAsUser.invoke(service, connection, flags, profile).on(getBaseContext())) {
				Log.d(TAG, "Connecting to service in profile: " + service);
				return true;
			}
		} catch (final SecurityException ignored) {}	// Very few devices still throw SecurityException, cause known.

		final ShuttleServiceConnection existent = mConnections.get(connection);
		final ShuttleServiceConnection shuttle_connection = existent != null ? existent : connection instanceof ShuttleServiceConnection
				? (ShuttleServiceConnection) connection : new ShuttleServiceConnection() {
					@Override public void onServiceConnected(final IBinder service) {
						connection.onServiceConnected(null, service);
					}
					@Override public void onServiceDisconnected() {
						connection.onServiceDisconnected(null);
					}
					@Override public void onServiceFailed() { Log.w(TAG, "Service failed: " + service); }
					@Override public String toString() { return TAG + "{" + connection + "}"; }
				};

		final boolean result = ServiceShuttle.bindServiceViaShuttle(getBaseContext(), service, shuttle_connection, flags);
		if (result && existent == null) mConnections.put(connection, shuttle_connection);
		return result;
	}
Context wrapper for service shuttle

Created by Oasis on 2017/2/16.
shared/src/main/java/com/oasisfeng/island/shuttle/ServiceShuttleContext.java