diff --git a/arkui/napi/libnapi.ndk.json b/arkui/napi/libnapi.ndk.json index 7460d98aed06b385f9036a8fe808bafaa9ddad7d..5bdd52c3319ed72b1336febe33d107efccf6a98d 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 332995c92cb80ba89252dfdafc64689d39b164bb..d1dc1c45c882003315bf1882a8f288f42ba8ddfe 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.