From 6f94050739cb0ca5d637158c0753ad294be03456 Mon Sep 17 00:00:00 2001 From: huangshiwei Date: Mon, 20 May 2024 16:45:53 +0800 Subject: [PATCH] huangshiwei4@huawei.com Signed-off-by: huangshiwei --- services/appmgr/src/app_mgr_service_inner.cpp | 2 +- services/appmgr/src/app_spawn_client.cpp | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index 0e4c608025..28b79a4a35 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -4462,7 +4462,7 @@ int AppMgrServiceInner::StartRenderProcess(const pid_t hostPid, const std::strin int32_t childNumLimit = appRecord->GetIsGPU() ? PHONE_MAX_RENDER_PROCESS_NUM + 1 : PHONE_MAX_RENDER_PROCESS_NUM; // The phone device allows a maximum of 40 render processes to be created. if (AAFwk::AppUtils::GetInstance().IsLimitMaximumOfRenderProcess() && - renderRecordMap.size() >= childNumLimit) { + renderRecordMap.size() >= static_cast(childNumLimit)) { TAG_LOGE(AAFwkTag::APPMGR, "Reaching the maximum render process limitation, hostPid:%{public}d", hostPid); return ERR_REACHING_MAXIMUM_RENDER_PROCESS_LIMITATION; } diff --git a/services/appmgr/src/app_spawn_client.cpp b/services/appmgr/src/app_spawn_client.cpp index ff4f2ca156..b37be945c1 100644 --- a/services/appmgr/src/app_spawn_client.cpp +++ b/services/appmgr/src/app_spawn_client.cpp @@ -172,11 +172,13 @@ int32_t AppSpawnClient::SetMountPermission(const AppSpawnStartMsg &startMsg, App } } - if (!startMsg.processType.empty() && - (ret = AppSpawnReqMsgAddExtInfo(reqHandle, MSG_EXT_NAME_PROCESS_TYPE, - reinterpret_cast(startMsg.processType.c_str()), startMsg.processType.size()))) { - HILOG_ERROR("AppSpawnReqMsgAddExtInfo failed, ret: %{public}d", ret); - return ret; + if (!startMsg.processType.empty()) { + ret = AppSpawnReqMsgAddExtInfo(reqHandle, MSG_EXT_NAME_PROCESS_TYPE, + reinterpret_cast(startMsg.processType.c_str()), startMsg.processType.size()); + if (ret) { + TAG_LOGE(AAFwkTag::APPMGR, "AppSpawnReqMsgAddExtInfo failed, ret: %{public}d", ret); + return ret; + } } return ret; @@ -216,9 +218,11 @@ int32_t AppSpawnClient::SetAtomicServiceFlag(const AppSpawnStartMsg &startMsg, A int32_t AppSpawnClient::SetStrictMode(const AppSpawnStartMsg &startMsg, AppSpawnReqMsgHandle reqHandle) { int32_t ret = 0; - if (startMsg.strictMode && - (ret = AppSpawnReqMsgSetAppFlag(reqHandle, APP_FLAGS_ISOLATED_SANDBOX))) { - HILOG_ERROR("AppSpawnReqMsgSetAppFlag failed, ret: %{public}d", ret); + if (startMsg.strictMode) { + ret = AppSpawnReqMsgSetAppFlag(reqHandle, APP_FLAGS_ISOLATED_SANDBOX); + if (ret) { + TAG_LOGE(AAFwkTag::APPMGR, "AppSpawnReqMsgSetAppFlag failed, ret: %{public}d", ret); + } } return ret; } @@ -226,9 +230,11 @@ int32_t AppSpawnClient::SetStrictMode(const AppSpawnStartMsg &startMsg, AppSpawn int32_t AppSpawnClient::SetAppExtension(const AppSpawnStartMsg &startMsg, AppSpawnReqMsgHandle reqHandle) { int32_t ret = 0; - if (startMsg.isolatedExtension && - (ret = AppSpawnReqMsgSetAppFlag(reqHandle, APP_FLAGS_EXTENSION_SANDBOX))) { - HILOG_ERROR("AppSpawnReqMsgSetAppFlag failed, ret: %{public}d", ret); + if (startMsg.isolatedExtension) { + ret = AppSpawnReqMsgSetAppFlag(reqHandle, APP_FLAGS_EXTENSION_SANDBOX); + if (ret) { + TAG_LOGE(AAFwkTag::APPMGR, "AppSpawnReqMsgSetAppFlag failed, ret: %{public}d", ret); + } } return ret; }