private static String launchActivity(final Context context, final Intent intent) {
		final UserHandle user = intent.getParcelableExtra(Intent.EXTRA_USER);
		if (user != null) {
			intent.removeExtra(Intent.EXTRA_USER);
			context.sendOrderedBroadcastAsUser(intent, user, null, null, null, 0, null, null);
			return null;
		}

		final Uri uri = intent.getData();
		if (uri == null) return "No data in Intent: " + intent;
		final String scheme = uri.getScheme();

		if ("package".equals(scheme)) {
			final String pkg = uri.getSchemeSpecificPart();
			final String free_to_launch = IslandManager.ensureAppFreeToLaunch(context, pkg);
			if (! free_to_launch.isEmpty()) return free_to_launch;
			return IslandManager.launchApp(context, pkg, Process.myUserHandle()) ? null : "no_launcher_activity";
		}

		if (! "intent".equals(scheme)) return "Unsupported intent data scheme: " + intent;
		final Intent target;
		try {
			target = Intent.parseUri(uri.toString(), Intent.URI_INTENT_SCHEME);
		} catch (final URISyntaxException e) {
			return "Invalid data in intent: " + intent;
		}
		if (! (context instanceof Activity)) target.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		try {
			context.startActivity(target);
		} catch (final ActivityNotFoundException e) {
			return e.toString();
		}
		return null;
	}
@return null for success, or error message for debugging purpose (NOT part of the API protocol).
engine/src/main/java/com/oasisfeng/island/api/ApiDispatcher.java