From fe2854a26c2116466c64f288830707a868ebb062 Mon Sep 17 00:00:00 2001 From: shilei Date: Sun, 1 Jun 2025 16:49:56 +0800 Subject: [PATCH] add multicontext interface Signed-off-by: shilei Change-Id: I8d0ed6b68650b06643b0c08ee9463bc05fc279ba --- arkui/napi/libnapi.ndk.json | 4 ++++ arkui/napi/native_api.h | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arkui/napi/libnapi.ndk.json b/arkui/napi/libnapi.ndk.json index 7460d98ae..5bdd52c33 100644 --- a/arkui/napi/libnapi.ndk.json +++ b/arkui/napi/libnapi.ndk.json @@ -247,6 +247,10 @@ "first_introduced": "20", "name": "napi_create_ark_context" }, + { + "first_introduced": "20", + "name": "napi_switch_ark_context" + }, { "first_introduced": "20", "name": "napi_destroy_ark_context" diff --git a/arkui/napi/native_api.h b/arkui/napi/native_api.h index 332995c92..d1dc1c45c 100644 --- a/arkui/napi/native_api.h +++ b/arkui/napi/native_api.h @@ -1653,6 +1653,18 @@ NAPI_EXTERN napi_status napi_define_class(napi_env env, */ NAPI_EXTERN napi_status napi_create_ark_context(napi_env env, napi_env *newEnv); +/** + * @brief To switch a virtual machine context which is expected to be used later. + * @param env Designated Virtual machine context which is expected to be used as the current virtual machine context. + * + * @return Returns the function execution status. + * {@link napi_ok } If the function executed successfully.\n + * {@link napi_invalid_arg } If the param env is nullptr.\n + * {@link napi_pending_exception } If have uncaught exception, or exception occurs in execution.\n + * @since 20 + */ +NAPI_EXTERN napi_status napi_switch_ark_context(napi_env env); + /** * @brief To destroy a virtual machine context which will not be used again. * @param env Virtual machine context expected to be destroyed. -- Gitee