private static boolean verifyRuntimePermission(final Context context, final int uid, final String action) {
		if (action == null) return false;
		final String permission;
		switch (action) {
		case Api.latest.ACTION_FREEZE:
		case Api.latest.ACTION_UNFREEZE:
			permission = Api.latest.PERMISSION_FREEZE_PACKAGE;	break;
		case Api.latest.ACTION_LAUNCH:
			permission = Api.latest.PERMISSION_LAUNCH_PACKAGE;	break;
		case Api.latest.ACTION_SUSPEND:
		case Api.latest.ACTION_UNSUSPEND:
			permission = Api.latest.PERMISSION_SUSPEND_PACKAGE;	break;
		default: return false;
		}
		return context.checkPermission(permission, 0, uid) == PackageManager.PERMISSION_GRANTED;
	}
Verify the qualification of this API invocation, mainly the permission of API caller.

@param pkg the package name of API caller, if known.
@param uid the UID of API caller, not used if caller_pkg is null. (negative if unavailable)
@return null if verified, or error message for debugging purpose (NOT part of the API protocol).
engine/src/main/java/com/oasisfeng/island/api/ApiDispatcher.java