From bed5560260d733698da170a4b40f6a0f44092252 Mon Sep 17 00:00:00 2001 From: AsukaSoryu Date: Fri, 10 Jul 2026 10:19:01 +0800 Subject: [PATCH] add ipc option for image start Signed-off-by: AsukaSoryu --- .../app_manager/src/appmgr/app_mgr_proxy.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/interfaces/inner_api/app_manager/src/appmgr/app_mgr_proxy.cpp b/interfaces/inner_api/app_manager/src/appmgr/app_mgr_proxy.cpp index 2d4c5d206d..90983b0365 100644 --- a/interfaces/inner_api/app_manager/src/appmgr/app_mgr_proxy.cpp +++ b/interfaces/inner_api/app_manager/src/appmgr/app_mgr_proxy.cpp @@ -48,7 +48,7 @@ void AppMgrProxy::AttachApplication(const sptr &obj) { MessageParcel data; MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); + MessageOption option(MessageOption::TF_SYNC | MessageOption::TF_IMAGE); if (!WriteInterfaceToken(data)) { return; } @@ -85,7 +85,7 @@ void AppMgrProxy::PreloadModuleFinished(const int32_t recordId) TAG_LOGD(AAFwkTag::APPMGR, "PreloadModuleFinished called"); MessageParcel data; MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); + MessageOption option(MessageOption::TF_ASYNC | MessageOption::TF_IMAGE); if (!WriteInterfaceToken(data)) { TAG_LOGE(AAFwkTag::APPMGR, "PreloadModuleFinished write interface token failed"); return; @@ -270,11 +270,13 @@ int32_t AppMgrProxy::GetAllRunningProcesses(std::vector &inf HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); MessageParcel data; MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); + MessageOption option(MessageOption::TF_SYNC | MessageOption::TF_IMAGE); if (!WriteInterfaceToken(data)) { return ERR_FLATTEN_OBJECT; } - if (!SendTransactCmd(AppMgrInterfaceCode::APP_GET_ALL_RUNNING_PROCESSES, data, reply)) { + int32_t result = SendRequest(AppMgrInterfaceCode::APP_GET_ALL_RUNNING_PROCESSES, data, reply, option); + if (result != NO_ERROR) { + TAG_LOGE(AAFwkTag::APPMGR, "receive error transact code %{public}d in transact cmd", result); return ERR_NULL_OBJECT; } auto error = GetParcelableInfos(reply, info); @@ -282,7 +284,7 @@ int32_t AppMgrProxy::GetAllRunningProcesses(std::vector &inf TAG_LOGE(AAFwkTag::APPMGR, "GetParcelableInfos fail, error: %{public}d", error); return error; } - int result = reply.ReadInt32(); + result = reply.ReadInt32(); return result; } @@ -476,11 +478,14 @@ int32_t AppMgrProxy::GetProcessRunningInformation(RunningProcessInfo &info) { MessageParcel data; MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC | MessageOption::TF_IMAGE); if (!WriteInterfaceToken(data)) { return ERR_FLATTEN_OBJECT; } - if (!SendTransactCmd(AppMgrInterfaceCode::APP_GET_PROCESS_RUNNING_INFORMATION, data, reply)) { + int32_t result = SendRequest(AppMgrInterfaceCode::APP_GET_PROCESS_RUNNING_INFORMATION, data, reply, option); + if (result != NO_ERROR) { + TAG_LOGE(AAFwkTag::APPMGR, "receive error transact code %{public}d in transact cmd", result); return ERR_NULL_OBJECT; } std::unique_ptr infoReply(reply.ReadParcelable()); @@ -2387,7 +2392,7 @@ int32_t AppMgrProxy::SetSupportedProcessCacheSelf(bool isSupport) PARCEL_UTIL_WRITE_RET_INT(data, Bool, isSupport); MessageParcel reply; - MessageOption option; + MessageOption option(MessageOption::TF_IMAGE); PARCEL_UTIL_SENDREQ_RET_INT(AppMgrInterfaceCode::SET_SUPPORTED_PROCESS_CACHE_SELF, data, reply, option); return reply.ReadInt32();