From b57d6111d40db96a6a02304d428a2ad80c18fb4b Mon Sep 17 00:00:00 2001 From: sty Date: Mon, 23 Jun 2025 14:30:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=80=85=E5=A3=B0=E6=98=8E=E5=A4=87=E9=80=89=E4=B8=BB=E6=8E=A7?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E9=BB=84=E8=93=9D=E4=B8=80=E8=87=B4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sty Change-Id: Id2a30b1123051c3255247c11cd7bb691d4e4bc83 --- services/appmgr/src/app_mgr_service_inner.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index d096db2f29a..6a7e15190e4 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -5384,10 +5384,10 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap TAG_LOGE(AAFwkTag::APPMGR, "disable start process in logout user"); return; } - + std::string specifiedProcessFlag = GetSpecifiedProcessFlag(abilityInfo, want); std::string processName; auto abilityInfoPtr = std::make_shared(abilityInfo); - MakeProcessName(abilityInfoPtr, appInfo, hapModuleInfo, appIndex, "", processName, false); + MakeProcessName(abilityInfoPtr, appInfo, hapModuleInfo, appIndex, specifiedProcessFlag, processName, false); bool isExtensionSandBox = IsIsolateExtensionSandBox(abilityInfoPtr, hapModuleInfo); std::vector hapModules; @@ -5397,7 +5397,7 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap auto instanceKey = want.GetStringParam(Want::APP_INSTANCE_KEY); auto customProcessFlag = abilityInfo.process; appRecord = appRunningManager_->CheckAppRunningRecordIsExist(appInfo->name, processName, appInfo->uid, bundleInfo, - "", nullptr, instanceKey, customProcessFlag); + specifiedProcessFlag, nullptr, instanceKey, customProcessFlag); if (!appRecord) { bool appExistFlag = appRunningManager_->IsAppExist(appInfo->accessTokenId); bool appMultiUserExistFlag = appRunningManager_->CheckAppRunningRecordIsExistByUid(bundleInfo.uid); @@ -5442,6 +5442,7 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap appRecord->SendEventForSpecifiedAbility(); appRecord->SetAppIndex(appIndex); appRecord->SetExtensionSandBoxFlag(isExtensionSandBox); + appRecord->SetSpecifiedProcessFlag(specifiedProcessFlag); uint32_t startFlags = AppspawnUtil::BuildStartFlags(want, abilityInfo); StartProcess(appInfo->name, processName, startFlags, appRecord, appInfo->uid, bundleInfo, appInfo->bundleName, appIndex, appExistFlag); -- Gitee From 652ce1a21e73a2d3d2f61c36a2436afc8da14a90 Mon Sep 17 00:00:00 2001 From: sty Date: Tue, 24 Jun 2025 14:42:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=80=85=E5=A3=B0=E6=98=8E=E5=A4=87=E9=80=89=E4=B8=BB=E6=8E=A7?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E9=94=99=E8=AF=AF=E6=8F=8F=E8=BF=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sty Change-Id: I999f6373113b889049108f670f5cbb36275107ab --- .../ability_business_error/ability_business_error.cpp | 8 ++++---- services/appmgr/src/app_mgr_service_inner.cpp | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/frameworks/native/ability/native/ability_business_error/ability_business_error.cpp b/frameworks/native/ability/native/ability_business_error/ability_business_error.cpp index 2cca9a6cdcc..4e8c21c052f 100644 --- a/frameworks/native/ability/native/ability_business_error/ability_business_error.cpp +++ b/frameworks/native/ability/native/ability_business_error/ability_business_error.cpp @@ -124,12 +124,12 @@ constexpr const char* ERROR_MSG_NOT_IN_KIOSK_MODE = "The current application is not in the kiosk mode. Exit is not allowed."; constexpr const char* ERROR_MSG_APP_NOT_IN_FOCUS = "The current ability is not foreground."; -constexpr const char* ERROR_MSG_NOT_ISOLATION_PROCESS = "Current process is not running a component configured " - "with \"isolationProcess\", and cannot be set as a candidate master process."; +constexpr const char* ERROR_MSG_NOT_ISOLATION_PROCESS = "The current process is not running a component configured " + "with \"isolationProcess\" and cannot be set as a candidate master process."; constexpr const char* ERROR_MSG_ALREADY_MASTER_PROCESS = - "Current process is already a master process, revocation is not supported."; + "The current process is already a master process and does not support cancellation."; constexpr const char* ERROR_MSG_NOT_CANDIDATE_MASTER_PROCESS = - "Current process is not a candidate master process, no need to revocation."; + "The current process is not a candidate master process and does not support cancellation."; // follow ERR_BUNDLE_MANAGER_BUNDLE_NOT_EXIST of appexecfwk_errors.h in bundle_framework constexpr int32_t ERR_BUNDLE_MANAGER_BUNDLE_NOT_EXIST = 8521220; diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index 6a7e15190e4..d096db2f29a 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -5384,10 +5384,10 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap TAG_LOGE(AAFwkTag::APPMGR, "disable start process in logout user"); return; } - std::string specifiedProcessFlag = GetSpecifiedProcessFlag(abilityInfo, want); + std::string processName; auto abilityInfoPtr = std::make_shared(abilityInfo); - MakeProcessName(abilityInfoPtr, appInfo, hapModuleInfo, appIndex, specifiedProcessFlag, processName, false); + MakeProcessName(abilityInfoPtr, appInfo, hapModuleInfo, appIndex, "", processName, false); bool isExtensionSandBox = IsIsolateExtensionSandBox(abilityInfoPtr, hapModuleInfo); std::vector hapModules; @@ -5397,7 +5397,7 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap auto instanceKey = want.GetStringParam(Want::APP_INSTANCE_KEY); auto customProcessFlag = abilityInfo.process; appRecord = appRunningManager_->CheckAppRunningRecordIsExist(appInfo->name, processName, appInfo->uid, bundleInfo, - specifiedProcessFlag, nullptr, instanceKey, customProcessFlag); + "", nullptr, instanceKey, customProcessFlag); if (!appRecord) { bool appExistFlag = appRunningManager_->IsAppExist(appInfo->accessTokenId); bool appMultiUserExistFlag = appRunningManager_->CheckAppRunningRecordIsExistByUid(bundleInfo.uid); @@ -5442,7 +5442,6 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap appRecord->SendEventForSpecifiedAbility(); appRecord->SetAppIndex(appIndex); appRecord->SetExtensionSandBoxFlag(isExtensionSandBox); - appRecord->SetSpecifiedProcessFlag(specifiedProcessFlag); uint32_t startFlags = AppspawnUtil::BuildStartFlags(want, abilityInfo); StartProcess(appInfo->name, processName, startFlags, appRecord, appInfo->uid, bundleInfo, appInfo->bundleName, appIndex, appExistFlag); -- Gitee