From cb332ca53e2ff375650f546b71dbf2b97405b215 Mon Sep 17 00:00:00 2001 From: luyifan <842825214@qq.com> Date: Sun, 27 Apr 2025 16:22:07 +0800 Subject: [PATCH] Send apiTargetVersion to xpm. Signed-off-by: luyifan <842825214@qq.com> --- interfaces/innerkits/include/appspawn.h | 1 + modules/common/appspawn_common.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/interfaces/innerkits/include/appspawn.h b/interfaces/innerkits/include/appspawn.h index 7372aff2..2403c732 100644 --- a/interfaces/innerkits/include/appspawn.h +++ b/interfaces/innerkits/include/appspawn.h @@ -295,6 +295,7 @@ int AppSpawnClientAddPermission(AppSpawnClientHandle handle, AppSpawnReqMsgHandl #define MSG_EXT_NAME_JIT_PERMISSIONS "Permissions" #define MSG_EXT_NAME_USERID "uid" #define MSG_EXT_NAME_EXTENSION_TYPE "ExtensionType" +#define MSG_EXT_NAME_API_TARGET_VERSION "APITargetVersion" int AppSpawnReqMsgAddExtInfo(AppSpawnReqMsgHandle reqHandle, const char *name, const uint8_t *value, uint32_t valueLen); diff --git a/modules/common/appspawn_common.c b/modules/common/appspawn_common.c index 6ce56b27..5eb56101 100644 --- a/modules/common/appspawn_common.c +++ b/modules/common/appspawn_common.c @@ -220,7 +220,9 @@ static int SetXpmConfig(const AppSpawnMgr *content, const AppSpawningCtx *proper idType = PROCESS_OWNERID_APP; ownerId = ownerInfo->ownerId; } - int ret = InitXpm(jitfortEnable, idType, ownerId); + + char *apiTargetVersionStr = GetAppPropertyExt(property, MSG_EXT_NAME_API_TARGET_VERSION, &len); + int ret = InitXpm(jitfortEnable, idType, ownerId, apiTargetVersionStr); APPSPAWN_CHECK(ret == 0, return ret, "set xpm region failed: %{public}d", ret); #endif return 0; -- Gitee