From 3bedcb90dbb5c4bebd69cdfe3040dc7bdd9230be Mon Sep 17 00:00:00 2001 From: zhangzezhong Date: Wed, 20 Aug 2025 06:00:06 -0400 Subject: [PATCH] fixed getRunningMultiApplnfo issue Signed-off-by: zhangzezhong --- .../ets/ani/app_manager/src/ets_app_manager_utils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frameworks/ets/ani/app_manager/src/ets_app_manager_utils.cpp b/frameworks/ets/ani/app_manager/src/ets_app_manager_utils.cpp index 4df183ce306..aeaea0a5381 100644 --- a/frameworks/ets/ani/app_manager/src/ets_app_manager_utils.cpp +++ b/frameworks/ets/ani/app_manager/src/ets_app_manager_utils.cpp @@ -29,8 +29,9 @@ namespace { constexpr const char *DATA_CLASS_NAME = "Lapplication/AppStateData/AppStateData;"; constexpr const char *CLASSNAME_ARRAY = "Lescompat/Array;"; constexpr const char *INFO_INNER_CLASS_NAME = "Lapplication/RunningMultiAppInfo/RunningMultiAppInfoInner;"; -constexpr const char *INSTANCE_INNER_CLASS_NAME = "Lapplication/RunningMultiAppInfo/RunningMultiInstanceInfoInner;"; -constexpr const char *CLONE_INNER_CLASS_NAME = "Lapplication/RunningMultiAppInfo/RunningAppCloneInner;"; +constexpr const char *INSTANCE_INNER_CLASS_NAME = + "Lapplication/RunningMultiInstanceInfo/RunningMultiInstanceInfoInner;"; +constexpr const char *CLONE_INNER_CLASS_NAME = "Lapplication/RunningAppClone/RunningAppCloneInner;"; constexpr const char *PROCESS_DATA_CLASS_NAME = "Lapplication/ProcessData/ProcessData;"; constexpr const char *MULTI_APP_MODE_ENUM_NAME = "Lapplication/MultiAppMode/MultiAppMode;"; constexpr const char *KEEP_ALIVE_APP_TYPE_ENUM_NAME = "L@ohos/app/ability/appManager/appManager/KeepAliveAppType;"; @@ -561,7 +562,8 @@ bool SetRunningAppClone(ani_env *env, ani_object object, const AppExecFwk::Runni } ani_size index = 0; for (auto &pid : runningAppClone.pids) { - status = env->Object_CallMethodByName_Void(arrayObj, "$_set", "II;:V", index, pid); + ani_object aniPid = AppExecFwk::CreateInt(env, pid); + status = env->Object_CallMethodByName_Void(arrayObj, "$_set", "ILstd/core/Object;:V", index, aniPid); if (status != ANI_OK) { TAG_LOGE(AAFwkTag::APPMGR, "set failed status : %{public}d", status); return false; -- Gitee