From 3e21800c6f7b94283cfbcfde08cfb19177d5a5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 08:46:42 +0000 Subject: [PATCH 01/26] =?UTF-8?q?=E4=BB=A3=E7=A2=BC=E5=B7=AE=E7=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../src/system_ability_mgr_util_test.cpp | 38 ++++++++++++++++--- ...stem_ability_state_scheduler_proc_test.cpp | 11 ------ services/samgr/var.gni | 2 +- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp index 8d5201a0..18c3cb39 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp @@ -37,11 +37,12 @@ namespace system { const std::u16string PROCESS_NAME = u"test_process_name"; constexpr const char* PENG_LAI = "penglai"; -struct CfgFiles { +struct CfgFiles +{ const char* paths[MAX_CFG_POLICY_DIRS_CNT]; }; -CfgFiles* g_mockCfgFiles = nullptr; +CfgFiles* mockCfgFiles = nullptr; std::vector mockDirFiles; void InitSaMgr(sptr& saMgr) @@ -63,7 +64,7 @@ void GetDirFiles(const char* path, std::vector& files) CfgFiles* GetCfgFiles(const char* path) { - return g_mockCfgFiles; + return mockCfgFiles; } void SamgrUtilTest::SetUpTestCase() @@ -81,7 +82,7 @@ void SamgrUtilTest::SetUp() SamMockPermission::MockPermission(); system::mockValue = ""; mockDirFiles.clear(); - g_mockCfgFiles = nullptr; + mockCfgFiles = nullptr; DTEST_LOG << "SetUp" << std::endl; } @@ -433,12 +434,37 @@ HWTEST_F(SamgrUtilTest, TestGetFilesByPriority001, TestSize.Level3) HWTEST_F(SamgrUtilTest, TestGetFilesByPriority002, TestSize.Level3) { system::mockValue = ""; - g_mockCfgFiles = new CfgFiles(); + mockCfgFiles = new CfgFiles(); std::vector result; SamgrUtil::GetFilesByPriority("test_path", result); ASSERT_TRUE(result.empty()); - delete g_mockCfgFiles; + delete mockCfgFiles; +} + +#iddef SUPPORT_PENGLAI_MODE +/** + * @tc.name: InitPenglaiFunc001 + * @tc.desc: test InitPenglaiFunc + * @tc.type: FUNC + */ +HWTEST_F(SamgrUtilTest, InitPenglaiFunc001, TestSize.Level3) +{ + system::mockValue = PENG_LAI; + void* func = SamgrUtil::InitPenglaiFunc(); + EXPECT_TRUE(func != nullptr); +} + +/** + * @tc.name: CheckPenglaiPermission001 + * @tc.desc: test CheckPenglaiPermission + * @tc.type: FUNC + */ +HWTEST_F(SamgrUtilTest, CheckPenglaiPermission001, TestSize.Level3) +{ + system::penglaiFunc_ = PENG_LAI; + bool ret = SamgrUtil::CheckPenglaiPermission(1); + EXPECT_TRUE(ret); } } \ No newline at end of file diff --git a/services/samgr/native/test/unittest/src/system_ability_state_scheduler_proc_test.cpp b/services/samgr/native/test/unittest/src/system_ability_state_scheduler_proc_test.cpp index c55ace60..67b7555a 100644 --- a/services/samgr/native/test/unittest/src/system_ability_state_scheduler_proc_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_state_scheduler_proc_test.cpp @@ -39,17 +39,6 @@ constexpr int32_t STATENUMS = 1; const std::u16string process = u"test"; const std::u16string process_invalid = u"test_invalid"; const std::string LOCAL_DEVICE = "local"; -void InitSaMgr(sptr& saMgr) -{ - saMgr->abilityDeath_ = sptr(new AbilityDeathRecipient()); - saMgr->systemProcessDeath_ = sptr(new SystemProcessDeathRecipient()); - saMgr->abilityStatusDeath_ = sptr(new AbilityStatusDeathRecipient()); - saMgr->abilityCallbackDeath_ = sptr(new AbilityCallbackDeathRecipient()); - saMgr->remoteCallbackDeath_ = sptr(new RemoteCallbackDeathRecipient()); - saMgr->workHandler_ = make_shared("workHandler"); - saMgr->collectManager_ = sptr(new DeviceStatusCollectManager()); - saMgr->abilityStateScheduler_ = std::make_shared(); -} } void SystemAbilityStateSchedulerProcTest::SetUpTestCase() diff --git a/services/samgr/var.gni b/services/samgr/var.gni index 19982e76..6998a8bf 100644 --- a/services/samgr/var.gni +++ b/services/samgr/var.gni @@ -49,7 +49,7 @@ declare_args() { samgr_support_access_token = false } if (defined(global_parts_info) && - defined(global_parts_info.penglai_penglai_mode_service)) { + defined(global_parts_info.penglai_PenglaiModeService)) { support_penglai_mode = true } } -- Gitee From ef6c59d476a326dd0e4f10c3168f7ba907a7e7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:15:24 +0000 Subject: [PATCH 02/26] daimaxiugai MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../native/test/unittest/src/common_event_collect_test.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/services/samgr/native/test/unittest/src/common_event_collect_test.cpp b/services/samgr/native/test/unittest/src/common_event_collect_test.cpp index 3d8d9599..2a61f876 100644 --- a/services/samgr/native/test/unittest/src/common_event_collect_test.cpp +++ b/services/samgr/native/test/unittest/src/common_event_collect_test.cpp @@ -166,7 +166,6 @@ HWTEST_F(CommonEventCollectTest, ProcessEvent001, TestSize.Level3) EXPECT_EQ(true, ret); ret = commonEventCollect->workHandler_->SendEvent(COMMON_DIED_EVENT); EXPECT_EQ(true, ret); - commonEventCollect->workHandler_->CleanFfrt(); DTEST_LOG << " ProcessEvent001 END" << std::endl; } @@ -407,7 +406,6 @@ HWTEST_F(CommonEventCollectTest, RemoveOnDemandReasonExtraData001, TestSize.Leve commonEventCollect->SaveOnDemandReasonExtraData(eventData); commonEventCollect->RemoveOnDemandReasonExtraData(1); EXPECT_TRUE(commonEventCollect->extraDatas_.empty()); - commonEventCollect->workHandler_->CleanFfrt(); DTEST_LOG << "RemoveOnDemandReasonExtraData001 end" << std::endl; } @@ -448,7 +446,6 @@ HWTEST_F(CommonEventCollectTest, GetOnDemandReasonExtraData002, TestSize.Level3) commonEventCollect->SaveOnDemandReasonExtraData(eventData); bool ret = commonEventCollect->GetOnDemandReasonExtraData(1, onDemandReasonExtraData); EXPECT_TRUE(ret); - commonEventCollect->workHandler_->CleanFfrt(); DTEST_LOG << "GetOnDemandReasonExtraData002 end" << std::endl; } -- Gitee From f8a4e610e3762624c7aac3ab1ec851e7f9b3464e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:15:49 +0000 Subject: [PATCH 03/26] daim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../native/test/unittest/src/device_networking_collect_test.cpp | 1 - .../test/unittest/src/device_status_collect_manager_test.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/services/samgr/native/test/unittest/src/device_networking_collect_test.cpp b/services/samgr/native/test/unittest/src/device_networking_collect_test.cpp index ca2d55de..0656f2e0 100644 --- a/services/samgr/native/test/unittest/src/device_networking_collect_test.cpp +++ b/services/samgr/native/test/unittest/src/device_networking_collect_test.cpp @@ -681,7 +681,6 @@ HWTEST_F(DeviceNetworkingCollectTest, SendEvent001, TestSize.Level3) std::function callback = [] () {}; sptr collectOne = new DeviceNetworkingCollect(nullptr); collectOne->PostTask(callback); - networkingCollect->workHandler_->handler_ = std::make_shared("WorkHandler"); bool bRet = networkingCollect->workHandler_->SendEvent(DM_DIED_EVENT); EXPECT_EQ(true, bRet); diff --git a/services/samgr/native/test/unittest/src/device_status_collect_manager_test.cpp b/services/samgr/native/test/unittest/src/device_status_collect_manager_test.cpp index 1cadd123..89b11bee 100644 --- a/services/samgr/native/test/unittest/src/device_status_collect_manager_test.cpp +++ b/services/samgr/native/test/unittest/src/device_status_collect_manager_test.cpp @@ -531,7 +531,6 @@ HWTEST_F(DeviceStatusCollectManagerTest, ReportEvent003, TestSize.Level3) OnDemandEvent event = { DEVICE_ONLINE, SA_TAG_DEVICE_ON_LINE, "on" }; std::list saControlList; SaProfile saProfile; - collect->collectHandler_ = std::make_shared("collect"); OnDemandEvent event1 = { DEVICE_ONLINE, SA_TAG_DEVICE_ON_LINE, "on" }; OnDemandEvent event2 = { DEVICE_ONLINE, SA_TAG_DEVICE_ON_LINE, "off" }; saProfile.startOnDemand.onDemandEvents.emplace_back(event1); -- Gitee From 9fb7a2ff8f6136799e613e4b626c45a6d6965b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:16:09 +0000 Subject: [PATCH 04/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../src/system_ability_mgr_stub_load_test.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_stub_load_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_stub_load_test.cpp index bb43b9c5..7435eddd 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_stub_load_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_stub_load_test.cpp @@ -41,17 +41,6 @@ const string DEFAULT_LOAD_NAME = "loadevent"; constexpr uint32_t SAID = 1499; constexpr int64_t DEFAULT_EVENTID = 0; constexpr int32_t INVALID_SAID = -1; -void InitSaMgr(sptr& saMgr) -{ - saMgr->abilityDeath_ = sptr(new AbilityDeathRecipient()); - saMgr->systemProcessDeath_ = sptr(new SystemProcessDeathRecipient()); - saMgr->abilityStatusDeath_ = sptr(new AbilityStatusDeathRecipient()); - saMgr->abilityCallbackDeath_ = sptr(new AbilityCallbackDeathRecipient()); - saMgr->remoteCallbackDeath_ = sptr(new RemoteCallbackDeathRecipient()); - saMgr->workHandler_ = make_shared("workHandler"); - saMgr->collectManager_ = sptr(new DeviceStatusCollectManager()); - saMgr->abilityStateScheduler_ = std::make_shared(); -} } void SystemAbilityMgrStubLoadTest::SetUpTestCase() -- Gitee From 92428636fdaeb46bff6831dad3a70886c37bceff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:16:19 +0000 Subject: [PATCH 05/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../test/unittest/src/system_ability_mgr_load_test.cpp | 1 + .../test/unittest/src/system_ability_mgr_new_test.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_load_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_load_test.cpp index a9a10949..3007aeb1 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_load_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_load_test.cpp @@ -400,6 +400,7 @@ HWTEST_F(SystemAbilityMgrLoadTest, LoadRemoteSystemAbility001, TestSize.Level2) DTEST_LOG << "LoadRemoteSystemAbility001 begin" << std::endl; sptr saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); EXPECT_TRUE(saMgr != nullptr); + EXPECT_TRUE(saMgr != nullptr); int32_t systemAbilityId = TEST_EXCEPTION_LOW_SA_ID; std::string deviceId = ""; int32_t result = saMgr->LoadSystemAbility(systemAbilityId, deviceId, nullptr); diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_new_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_new_test.cpp index 153125a3..87454cc0 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_new_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_new_test.cpp @@ -189,6 +189,7 @@ HWTEST_F(SystemAbilityMgrNewTest, GetLocalNodeId001, TestSize.Level3) sptr saMgr = new SystemAbilityManager; EXPECT_TRUE(saMgr != nullptr); InitSaMgr(saMgr); + string ret = saMgr->GetLocalNodeId(); EXPECT_EQ(ret, ""); } @@ -204,6 +205,7 @@ HWTEST_F(SystemAbilityMgrNewTest, ReportGetSAPeriodically001, TestSize.Level3) sptr saMgr = new SystemAbilityManager; EXPECT_TRUE(saMgr != nullptr); InitSaMgr(saMgr); + uint64_t pid_said = 123; int32_t count = 1; saMgr->saFrequencyMap_[pid_said] = count; @@ -222,6 +224,7 @@ HWTEST_F(SystemAbilityMgrNewTest, StartDynamicSystemProcess001, TestSize.Level3) sptr saMgr = new SystemAbilityManager; EXPECT_TRUE(saMgr != nullptr); InitSaMgr(saMgr); + std::u16string invalidProcess = u"1234567890123456789012345678901234567890123456789" "01234567890123456789012345678901234567890123456"; OnDemandEvent event; @@ -240,6 +243,7 @@ HWTEST_F(SystemAbilityMgrNewTest, GetSystemAbilityWithDevice001, TestSize.Level3 sptr saMgr = new SystemAbilityManager; EXPECT_TRUE(saMgr != nullptr); InitSaMgr(saMgr); + std::string deviceId = ""; auto ability = saMgr->GetSystemAbility(TEST_EXCEPTION_LOW_SA_ID, deviceId); EXPECT_EQ(ability, nullptr); @@ -278,6 +282,7 @@ HWTEST_F(SystemAbilityMgrNewTest, GetSystemAbilityFromRemote002, TestSize.Level3 sptr saMgr = new SystemAbilityManager; EXPECT_TRUE(saMgr != nullptr); InitSaMgr(saMgr); + auto ability = saMgr->GetSystemAbilityFromRemote(TEST_SYSTEM_ABILITY1); EXPECT_EQ(ability, nullptr); } @@ -291,6 +296,7 @@ HWTEST_F(SystemAbilityMgrNewTest, GetSystemAbilityFromRemote003, TestSize.Level3 { sptr saMgr = new SystemAbilityManager; EXPECT_TRUE(saMgr != nullptr); + EXPECT_TRUE(saMgr != nullptr); InitSaMgr(saMgr); SAInfo saInfo; saMgr->abilityMap_[1] = saInfo; @@ -1142,7 +1148,6 @@ HWTEST_F(SystemAbilityMgrNewTest, DoLoadForPerf001, TestSize.Level2) sptr saMgr = new SystemAbilityManager; EXPECT_TRUE(saMgr != nullptr); InitSaMgr(saMgr); - saMgr->abilityStateScheduler_ = std::make_shared(); CommonSaProfile saProfile; saProfile.process = u"memmgrservice"; saMgr->saProfileMap_[-1] = saProfile; @@ -1184,7 +1189,6 @@ HWTEST_F(SystemAbilityMgrNewTest, RegisterDistribute001, TestSize.Level2) sptr saMgr = new SystemAbilityManager(); EXPECT_FALSE(saMgr == nullptr); InitSaMgr(saMgr); - saMgr->Init(); saMgr->isDbinderServiceInit_ = false; saMgr->distributedSaList_.push_back(softBusServerSaID); saMgr->InitDbinderService(); -- Gitee From f06aeb0bdbaa6dc21909734d7d1228a2a9ad56db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:16:37 +0000 Subject: [PATCH 06/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../unittest/src/system_ability_mgr_proxy_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp index dc33f42f..3a512aba 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp @@ -1340,6 +1340,11 @@ HWTEST_F(SystemAbilityMgrProxyTest, GetLruIdleSystemAbilityProc002, TestSize.Lev EXPECT_NE(res, ERR_OK); } +/** + * @tc.name: UnloadProcess002 + * @tc.desc: UnloadProcess base interface cover + * @tc.type: FUNC + */ HWTEST_F(SystemAbilityMgrProxyTest, UnloadProcess002, TestSize.Level3) { DTEST_LOG << " UnloadProcess002 begin " << std::endl; @@ -1351,6 +1356,11 @@ HWTEST_F(SystemAbilityMgrProxyTest, UnloadProcess002, TestSize.Level3) DTEST_LOG << " UnloadProcess002 end " << std::endl; } +/** + * @tc.name: GetLruIdleSystemAbilityProc003 + * @tc.desc: GetLruIdleSystemAbilityProc base interface cover + * @tc.type: FUNC + */ HWTEST_F(SystemAbilityMgrProxyTest, GetLruIdleSystemAbilityProc003, TestSize.Level3) { DTEST_LOG << " GetLruIdleSystemAbilityProc003 begin " << std::endl; -- Gitee From 6a59381b5e8c4f8bb929820959122a681d1fbc54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:16:47 +0000 Subject: [PATCH 07/26] daim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../samgr/native/test/unittest/src/system_ability_mgr_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_test.cpp index d17794e4..b55af14b 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_test.cpp @@ -1631,7 +1631,7 @@ HWTEST_F(SystemAbilityMgrTest, GetDeviceName001, TestSize.Level3) HWTEST_F(SystemAbilityMgrTest, OnAbilityCallbackDied001, TestSize.Level3) { sptr saMgr = new SystemAbilityManager; - InitSaMgr(saMgr); + saMgr->startingAbilityMap_.clear(); saMgr->OnAbilityCallbackDied(nullptr); EXPECT_TRUE(saMgr->startingAbilityMap_.empty()); } -- Gitee From 09a73f4cb383169313dfeb35e3e3f589b48b2fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:16:56 +0000 Subject: [PATCH 08/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../src/system_ability_mgr_stub_test.cpp | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_stub_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_stub_test.cpp index 07c8189c..54be0331 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_stub_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_stub_test.cpp @@ -44,9 +44,27 @@ constexpr int32_t INVALID_SAID = -1; constexpr uint32_t INVALID_CODE = 50; } #ifdef SUPPORT_PENGLAI_MODE -namespace Penglai { +bool g_permissionRet = false; +void* g_originHandle = SamgrUtil::penglaiFunc_; +bool MockIsLaunchAllowedByUid(const int32_t callingUid, const int32_t systemAbilityId) +{ + return g_permissionRet; +} + +void SetpenglaiPerm(bool permission) +{ + SamgrUtil::penglaiFunc_ = (void*)MockIsLaunchAllowedByUid; + g_permissionRet = permission; +} -extern bool permissionRet; +void UnSetpenglaiPerm() +{ + SamgrUtil::penglaiFunc_ = g_originHandle; +} + +void UnSetpenglaiPerm() +{ + SamgrUtil::penglaiFunc_ = g_originHandle; } #endif @@ -573,9 +591,10 @@ HWTEST_F(SystemAbilityMgrStubTest, CheckSystemAbilityImmeInner004, TestSize.Leve data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission denied - Penglai::permissionRet = false; + SetpenglaiPerm(false); int32_t result = saMgr->CheckSystemAbilityImmeInner(data, reply); EXPECT_EQ(result, ERR_PERMISSION_DENIED); + UnSetpenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -595,9 +614,10 @@ HWTEST_F(SystemAbilityMgrStubTest, CheckSystemAbilityImmeInner005, TestSize.Leve data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission true - Penglai::permissionRet = true; + SetpenglaiPerm(true); int32_t result = saMgr->CheckSystemAbilityImmeInner(data, reply); EXPECT_NE(result, ERR_PERMISSION_DENIED); + UnSetpenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -632,9 +652,10 @@ HWTEST_F(SystemAbilityMgrStubTest, GetSystemAbilityInner002, TestSize.Level3) data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission denied - Penglai::permissionRet = false; + SetpenglaiPerm(false); int32_t result = saMgr->GetSystemAbilityInner(data, reply); EXPECT_EQ(result, ERR_PERMISSION_DENIED); + UnSetpenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -654,9 +675,10 @@ HWTEST_F(SystemAbilityMgrStubTest, GetSystemAbilityInner003, TestSize.Level3) data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission true - Penglai::permissionRet = true; + SetpenglaiPerm(true); int32_t result = saMgr->GetSystemAbilityInner(data, reply); EXPECT_NE(result, ERR_PERMISSION_DENIED); + UnSetpenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -691,9 +713,10 @@ HWTEST_F(SystemAbilityMgrStubTest, CheckSystemAbilityInner002, TestSize.Level3) data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission denied - Penglai::permissionRet = false; + SetpenglaiPerm(false); int32_t result = saMgr->CheckSystemAbilityInner(data, reply); EXPECT_EQ(result, ERR_PERMISSION_DENIED); + UnSetpenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -713,9 +736,10 @@ HWTEST_F(SystemAbilityMgrStubTest, CheckSystemAbilityInner003, TestSize.Level3) data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission true - Penglai::permissionRet = true; + SetpenglaiPerm(true); int32_t result = saMgr->CheckSystemAbilityInner(data, reply); EXPECT_NE(result, ERR_PERMISSION_DENIED); + UnSetpenglaiPerm(); saMgr->SetPengLai(false); } #endif -- Gitee From 613ad281315d3232b5e9ce303869808f379d532a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:19:46 +0000 Subject: [PATCH 09/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../native/source/system_ability_manager_util.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/services/samgr/native/source/system_ability_manager_util.cpp b/services/samgr/native/source/system_ability_manager_util.cpp index 1f0ad3ba..31ebd1e2 100644 --- a/services/samgr/native/source/system_ability_manager_util.cpp +++ b/services/samgr/native/source/system_ability_manager_util.cpp @@ -28,9 +28,9 @@ namespace OHOS { namespace fs = std::filesystem; using namespace std; #ifdef SUPPORT_PENGLAI_MODE -using PenglaiFunc = bool (*) (const int32_t, const int32_t); +using PenglaiFunc = bool (*)(const int32_t, const int32_t); constexpr const char* PENGLAI_SO_PATH = "libpenglai_client.z.so"; -constexpr const char* PENGLAT_SYM = "IsLaunchAllowedByUid"; +constexpr const char* PENGLAI_SYM = "IsLaunchAllowedByUid"; void* SamgrUtil::penglaiFunc_ = InitPenglaiFunc(); #endif constexpr int32_t MAX_NAME_SIZE = 200; @@ -261,23 +261,24 @@ void* SamgrUtil::InitPenglaiFunc() HILOGE("InitPenglaiFunc dlopen %{public}s so failed.", PENGLAI_SO_PATH); return nullptr; } - void* func = dlsym(handle, PENGLAT_SYM); + void* func = dlsym(handle, PENGLAI_SYM); if (func == nullptr) { - HILOGE("InitPenglaiFunc dlsym %{public}s symbol failed.", PENGLAT_SYM); + HILOGE("InitPenglaiFunc dlsym %{public}s symbol failed.", PENGLAI_SYM); dlclose(handle); return nullptr; } - HILOGI("InitPenglaiFunc success"); + HILOGI("InitPenglaiFunc success."); return func; } bool SamgrUtil::CheckPengLaiPermission(int32_t systemAbilityId) { auto callingUid = IPCSkeleton::GetCallingUid(); + if (penglaiFunc_ == nullptr) { return true; } - PenglaiFunc IsLaunchAllowedByUid = (PenglaiFunc)PenglaiFunc_; + PenglaiFunc IsLaunchAllowedByUid = (PenglaiFunc)penglaiFunc_; bool isAllow = IsLaunchAllowedByUid(callingUid, systemAbilityId); if (!isAllow) { HILOGE("IsLaunchAllowedByUid failed. callingUid:%{public}d, SA:%{public}d", callingUid, systemAbilityId); @@ -309,7 +310,7 @@ void SamgrUtil::GetFilesFromPath(const std::string& path, std::map& fileNames) { std::map fileNamesMap; - + GetFilesFromPath(path, fileNamesMap); if (SamgrUtil::CheckPengLai()) { -- Gitee From db94c8ce08e822dcba8f4a483b8d3e677812f02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:58:43 +0000 Subject: [PATCH 10/26] dao MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- interfaces/innerkits/rust/tests/BUILD.gn | 2 +- test/fuzztest/samgrcoverage_fuzzer/BUILD.gn | 2 -- test/fuzztest/samgrdumper_fuzzer/BUILD.gn | 2 -- test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/interfaces/innerkits/rust/tests/BUILD.gn b/interfaces/innerkits/rust/tests/BUILD.gn index 8746daed..ed4d31d2 100644 --- a/interfaces/innerkits/rust/tests/BUILD.gn +++ b/interfaces/innerkits/rust/tests/BUILD.gn @@ -69,8 +69,8 @@ ohos_rust_systemtest("rust_samgr_sdv_test") { external_deps = [ "hilog:hilog_rust", "ipc:ipc_rust", - "safwk:system_ability_fwk_rust", "rust_cxx:lib" + "safwk:system_ability_fwk_rust", ] defines = [] if (samgr_support_access_token) { diff --git a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn index 58dd770f..e44b7bab 100644 --- a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn @@ -89,7 +89,6 @@ ohos_fuzztest("SamgrCoverageFuzzTest") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", - "samgr:dynamic_cache", "samgr:samgr_common", "samgr:samgr_proxy", ] @@ -113,7 +112,6 @@ ohos_fuzztest("SamgrCoverageFuzzTest") { defines += [ "SUPPORT_DEVICE_MANAGER" ] } if (support_penglai_mode) { - external_deps += [ "penglai_mode_service:penglai_client" ] defines += [ "SUPPORT_PENGLAI_MODE" ] } defines += ["SAMGR_USE_FFRT"] diff --git a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn index 536b4818..a4884847 100644 --- a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn @@ -88,7 +88,6 @@ ohos_fuzztest("SamgrDumperFuzzTest") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", - "samgr:dynamic_cache", "samgr:samgr_common", "samgr:samgr_proxy", ] @@ -114,7 +113,6 @@ ohos_fuzztest("SamgrDumperFuzzTest") { } if (support_penglai_mode) { - external_deps += [ "penglai_mode_service:penglai_client" ] defines += [ "SUPPORT_PENGLAI_MODE" ] } defines += ["SAMGR_USE_FFRT"] diff --git a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn index 9c9a24aa..021bffda 100644 --- a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn +++ b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn @@ -87,7 +87,6 @@ ohos_fuzztest("SystemAbilityManagerFuzzTest") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", - "samgr:dynamic_cache", "samgr:samgr_common", "samgr:samgr_proxy", ] @@ -113,7 +112,6 @@ ohos_fuzztest("SystemAbilityManagerFuzzTest") { } if (support_penglai_mode) { - external_deps += [ "penglai_mode_service:penglai_client" ] defines += [ "SUPPORT_PENGLAI_MODE" ] } defines += ["SAMGR_USE_FFRT"] -- Gitee From d3d860204cbff914feba11d892aa282b52486e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:58:50 +0000 Subject: [PATCH 11/26] dao MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- bundle.json | 5 +---- services/dfx/source/hisysevent_adapter.cpp | 2 +- test/fuzztest/samgr_fuzzer/BUILD.gn | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/bundle.json b/bundle.json index e83679d2..ca353215 100644 --- a/bundle.json +++ b/bundle.json @@ -35,8 +35,6 @@ "c_utils", "common_event_service", "device_manager", - "dsoftbus", - "eventhandler", "ffrt", "hicollie", "hilog", @@ -47,11 +45,10 @@ "json", "libxml2", "preferences", - "rust_cxx", "safwk", "selinux_adapter", "config_policy", - "ylong_runtime" + "rust_cxx" ] }, "build": { diff --git a/services/dfx/source/hisysevent_adapter.cpp b/services/dfx/source/hisysevent_adapter.cpp index 72c3629a..c4f0e3f0 100644 --- a/services/dfx/source/hisysevent_adapter.cpp +++ b/services/dfx/source/hisysevent_adapter.cpp @@ -62,7 +62,7 @@ constexpr int32_t CONTAINER_SA_MAX = 0x0001055f; //66911 static bool IsInCrashWhiteList(int32_t saId) { std::vector whiteList = { 1205, 1213, 1215, 9999, 65537, 65830, - 65850, 66064, 69930, 131071, 345135 }; + 65850, 65888, 69930, 131071, 345135 }; for (auto sa : whiteList) { if (saId == sa) { return true; diff --git a/test/fuzztest/samgr_fuzzer/BUILD.gn b/test/fuzztest/samgr_fuzzer/BUILD.gn index f72c43a5..8e9e07f8 100644 --- a/test/fuzztest/samgr_fuzzer/BUILD.gn +++ b/test/fuzztest/samgr_fuzzer/BUILD.gn @@ -185,7 +185,6 @@ foreach(item, samgr_fuzztests) { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", - "samgr:dynamic_cache", "samgr:samgr_common", "samgr:samgr_proxy", ] @@ -212,7 +211,6 @@ foreach(item, samgr_fuzztests) { } if (support_penglai_mode) { - external_deps += [ "penglai_mode_service:penglai_client" ] defines += [ "SUPPORT_PENGLAI_MODE" ] } defines += ["SAMGR_USE_FFRT"] -- Gitee From 064ef1855440d6b1f4538d14ff23925db510e040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:58:59 +0000 Subject: [PATCH 12/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../include/if_system_ability_manager.h | 14 +++----------- .../include/isystem_ability_status_change.h | 5 +++++ .../samgr_proxy/libsamgr_proxy.versionscript | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h b/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h index e794e80b..df81f033 100644 --- a/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h +++ b/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h @@ -29,13 +29,6 @@ #include "system_ability_on_demand_event.h" namespace OHOS { - -struct IdleProcessInfo { - int32_t pid = -1; - std::u16string processName; - int64_t lastIdleTime = 0; -}; - class ISystemAbilityManager : public IRemoteBroker { public: /** @@ -238,8 +231,7 @@ public: * UnloadProcess, unload process by process name list. * only support for memmgrservice * - * @param processList, Need a processList to unload. - * @return ERR_OK It means unload process in processList success. + * @return ERR_OK It means unload all process in list. */ virtual int32_t UnloadProcess(const std::vector& processList) { @@ -248,10 +240,10 @@ public: } /** - * GetLruIdleSystemAbilityProc, Get idle process info list. + * GetSystemProcessInfo, Get idle process info by said. * only support for memmgrservice * - * @param processInfos, Issue a parameter and return it as a result. + * @param processList, Issue a parameter and return it as a result. * @return ERR_OK indicates that the get successfully. */ virtual int32_t GetLruIdleSystemAbilityProc(std::vector& processInfos) diff --git a/interfaces/innerkits/samgr_proxy/include/isystem_ability_status_change.h b/interfaces/innerkits/samgr_proxy/include/isystem_ability_status_change.h index d0691d80..270fdb7b 100644 --- a/interfaces/innerkits/samgr_proxy/include/isystem_ability_status_change.h +++ b/interfaces/innerkits/samgr_proxy/include/isystem_ability_status_change.h @@ -21,6 +21,11 @@ #include "iremote_proxy.h" namespace OHOS { +struct IdleProcessInfo { + int32_t pid = -1; + std::u16string processName; + int64_t lastIdleTime = 0; +}; class ISystemAbilityStatusChange : public IRemoteBroker { public: diff --git a/interfaces/innerkits/samgr_proxy/libsamgr_proxy.versionscript b/interfaces/innerkits/samgr_proxy/libsamgr_proxy.versionscript index 22aa551d..d79a7e9a 100644 --- a/interfaces/innerkits/samgr_proxy/libsamgr_proxy.versionscript +++ b/interfaces/innerkits/samgr_proxy/libsamgr_proxy.versionscript @@ -33,7 +33,7 @@ *LocalAbilityManagerProxy*; *WriteOnDemandEventsToParcel*; *ReadOnDemandEventsFromParcel*; - *GetLocalAbilitymanagerProxy*; + *GetLocalAbilityManagerProxy*; local: *; }; -- Gitee From 6c187c19e92c043c250e2645cd305889ab4db358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:59:18 +0000 Subject: [PATCH 13/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../native/source/system_ability_manager.cpp | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/services/samgr/native/source/system_ability_manager.cpp b/services/samgr/native/source/system_ability_manager.cpp index 4ec3f076..8e6dbc80 100644 --- a/services/samgr/native/source/system_ability_manager.cpp +++ b/services/samgr/native/source/system_ability_manager.cpp @@ -84,6 +84,7 @@ constexpr int64_t CHECK_LOADED_DELAY_TIME = 4 * 1000; // ms #endif constexpr int32_t SOFTBUS_SERVER_SA_ID = 4700; constexpr int32_t FIRST_DUMP_INDEX = 0; +constexpr int32_t TWO_MINUTES_SECONDS = 120 * 1000; // ms } samgr::mutex SystemAbilityManager::instanceLock; @@ -1049,6 +1050,11 @@ int32_t SystemAbilityManager::AddSystemAbility(int32_t systemAbilityId, const sp return ERR_INVALID_VALUE; } RefreshListenerState(systemAbilityId); + if (extraProp.isDistributed != IsDistributedSystemAbility(systemAbilityId)) { + HILOGE("SA:%{public}d extraProp isDistributed:%{public}d different from saProfile", systemAbilityId, + extraProp.isDistributed); + return ERR_INVALID_VALUE; + } { unique_lock writeLock(abilityMapLock_); auto saSize = abilityMap_.size(); @@ -1056,11 +1062,6 @@ int32_t SystemAbilityManager::AddSystemAbility(int32_t systemAbilityId, const sp HILOGE("map size error, (Has been greater than %zu)", saSize); return ERR_INVALID_VALUE; } - if (extraProp.isDistributed != IsDistributedSystemAbility(systemAbilityId)) { - HILOGE("SA:%{public}d extraProp isDistributed:%{public}d different from saProfile", systemAbilityId, - extraProp.isDistributed); - return ERR_INVALID_VALUE; - } SAInfo saInfo = { ability, extraProp.isDistributed, extraProp.capability, Str16ToStr8(extraProp.permission) }; if (abilityMap_.count(systemAbilityId) > 0) { SystemAbilityInvalidateCache(systemAbilityId); @@ -1749,7 +1750,16 @@ int32_t SystemAbilityManager::GetLruIdleSystemAbilityProc(std::vector procInfos; for (const auto& saId : saIds) { IdleProcessInfo info; - if (!abilityStateScheduler_->GetIdleProcessInfo(saId, info)) { + int64_t lastStopTime = -1; + if (!abilityStateScheduler_->GetLruIdleSystemAbilityInfo(saId, info.processName, lastStopTime, info.pid)) { + continue; + } + info.lastIdleTime = ailityStateScheduler_->GetSystemAbilityInfo(saId); + if(info.lastIdleTime < 0) { + activeProcess.insert(info.processName); + continue; + } + if (lastStop != -1 && (GetTickCount() - lastStopTime < TWO_MINUTES_SECONDS)) { continue; } auto procInfo = procInfos.find(info.processName); @@ -1760,9 +1770,8 @@ int32_t SystemAbilityManager::GetLruIdleSystemAbilityProc(std::vectorIsSystemProcessCanUnload(pair.first)) { + if (activeProcess.find(pair.first) == activeProcess.end()) { processInfos.push_back(pair.second); - HILOGD("GetLruIdle processName:%{public}s", Str16ToStr8(pair.first).c_str()); } } std::sort(processInfos.begin(), processInfos.end(), [](const IdleProcessInfo& a, IdleProcessInfo& b) { -- Gitee From ce53090d2edf53784ae4c9a5cc8897f5e033922e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:59:24 +0000 Subject: [PATCH 14/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../samgr/native/include/system_ability_manager_stub.h | 2 +- .../native/source/system_ability_manager_stub.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/samgr/native/include/system_ability_manager_stub.h b/services/samgr/native/include/system_ability_manager_stub.h index 92187c64..25508b3c 100644 --- a/services/samgr/native/include/system_ability_manager_stub.h +++ b/services/samgr/native/include/system_ability_manager_stub.h @@ -228,7 +228,7 @@ private: int32_t GetCommonEventExtraDataIdlistInner(MessageParcel& data, MessageParcel& reply); int32_t GetLocalAbilityManagerProxyInner(MessageParcel& data, MessageParcel& reply); static int32_t GetHapIdMultiuser(int32_t uid); -#ifdef SUPPORT_PENGLAT_MODE +#ifdef SUPPORT_PENGLAI_MODE void SetPengLai(bool isPengLai); bool isPengLai_ = false; #endif diff --git a/services/samgr/native/source/system_ability_manager_stub.cpp b/services/samgr/native/source/system_ability_manager_stub.cpp index 46611c65..290377d5 100644 --- a/services/samgr/native/source/system_ability_manager_stub.cpp +++ b/services/samgr/native/source/system_ability_manager_stub.cpp @@ -124,7 +124,7 @@ const std::string EXT_TRANSACTION_PERMISSION = "ohos.permission.ACCESS_EXT_SYSTE const std::string PERMISSION_SVC = "ohos.permission.CONTROL_SVC_CMD"; } -#ifdef SUPPORT_PENGLAT_MODE +#ifdef SUPPORT_PENGLAI_MODE void SystemAbilityManagerStub::SetPengLai(bool isPengLai) { isPengLai_ = isPengLai; @@ -180,7 +180,7 @@ void SystemAbilityManagerStub::SetProcessFuncMap() SystemAbilityManagerStub::SystemAbilityManagerStub() { -#ifdef SUPPORT_PENGLAT_MODE +#ifdef SUPPORT_PENGLAI_MODE SetPengLai(SamgrUtil::CheckPengLai()); #endif SetAbilityFuncMap(); @@ -437,7 +437,7 @@ int32_t SystemAbilityManagerStub::CheckSystemAbilityImmeInner(MessageParcel& dat return ERR_NULL_OBJECT; } -#ifdef SUPPORT_PENGLAT_MODE +#ifdef SUPPORT_PENGLAI_MODE if (isPengLai_ && !SamgrUtil::CheckPengLaiPermission(systemAbilityId)) { HILOGW("CheckSAImme CheckPengLaiPermission denied! SA:%{public}d,callUid:%{public}d", systemAbilityId, OHOS::IPCSkeleton::GetCallingUid()); @@ -562,7 +562,7 @@ int32_t SystemAbilityManagerStub::GetSystemAbilityInner(MessageParcel& data, Mes return ERR_NULL_OBJECT; } -#ifdef SUPPORT_PENGLAT_MODE +#ifdef SUPPORT_PENGLAI_MODE if (isPengLai_ && !SamgrUtil::CheckPengLaiPermission(systemAbilityId)) { HILOGW("GetSA CheckPengLaiPermission denied! SA:%{public}d,callUid:%{public}d", systemAbilityId, OHOS::IPCSkeleton::GetCallingUid()); @@ -600,7 +600,7 @@ int32_t SystemAbilityManagerStub::CheckSystemAbilityInner(MessageParcel& data, M return ERR_NULL_OBJECT; } -#ifdef SUPPORT_PENGLAT_MODE +#ifdef SUPPORT_PENGLAI_MODE if (isPengLai_ && !SamgrUtil::CheckPengLaiPermission(systemAbilityId)) { HILOGW("CheckSA CheckPengLaiPermission denied! SA:%{public}d,callUid:%{public}d", systemAbilityId, OHOS::IPCSkeleton::GetCallingUid()); -- Gitee From 35b58ae52f3764208810153bdecc1fc70248709e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 12:59:29 +0000 Subject: [PATCH 15/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../schedule/system_ability_state_scheduler.h | 7 ++-- .../include/system_ability_manager_util.h | 4 +-- .../system_ability_state_scheduler.cpp | 34 +++++++------------ 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/services/samgr/native/include/schedule/system_ability_state_scheduler.h b/services/samgr/native/include/schedule/system_ability_state_scheduler.h index 6a727747..d17ec6d8 100644 --- a/services/samgr/native/include/schedule/system_ability_state_scheduler.h +++ b/services/samgr/native/include/schedule/system_ability_state_scheduler.h @@ -22,7 +22,6 @@ #include "ffrt_handler.h" #include "isystem_process_status_change.h" -#include "if_system_ability_manager.h" #include "nlohmann/json.hpp" #include "sa_profiles.h" #include "schedule/system_ability_event_handler.h" @@ -71,8 +70,10 @@ public: int32_t CheckStopEnableOnce(const OnDemandEvent& event, const SaControlInfo& saControl); void UpdateLimitDelayUnloadTime(int32_t systemAbilityId); void UpdateLimitDelayUnloadTimeTask(int32_t systemAbilityId); - bool GetIdleProcessInfo(int32_t systemAbilityId, IdleProcessInfo& idleProcessInfo); - bool IsSystemProcessCanUnload(const std::u16string& processName); + int64_t GetSystemAbilityIdleTime(int32_t systemAbilityId); + bool GetSystemAbilityIdleTime(int32_t systemAbilityId); + bool GetLruIdleSystemAbilityInfo(int32_t systemAbilityId , std::u16string& processName, int64_t& lastStopTime, + int32_t& pid); private: void InitStateContext(const std::list& saProfiles); diff --git a/services/samgr/native/include/system_ability_manager_util.h b/services/samgr/native/include/system_ability_manager_util.h index 938b7ac0..df8855d5 100644 --- a/services/samgr/native/include/system_ability_manager_util.h +++ b/services/samgr/native/include/system_ability_manager_util.h @@ -48,13 +48,13 @@ public: static void InvalidateSACache(); static void FilterCommonSaProfile(const SaProfile& oldProfile, CommonSaProfile& newProfile); static bool CheckPengLai(); -#ifdef SUPPORT_PENGLAT_MODE +#ifdef SUPPORT_PENGLAI_MODE static bool CheckPengLaiPermission(int32_t systemAbilityId); #endif static void GetFilesByPriority(const std::string& path, std::vector& files); static void GetFilesFromPath(const std::string& path, std::map& fileNamesMap); private: -#ifdef SUPPORT_PENGLAT_MODE +#ifdef SUPPORT_PENGLAI_MODE static void* InitPenglaiFunc(); static void* penglaiFunc_; #endif diff --git a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp index f0662a55..88f89fe9 100644 --- a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp +++ b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp @@ -41,7 +41,6 @@ constexpr const char* LOCAL_DEVICE = "local"; constexpr int32_t MAX_DELAY_TIME = 5 * 60 * 1000; constexpr int32_t MAX_DURATION = 10 * 60 * 1000; // ms constexpr int32_t ONCE_DELAY_TIME = 10 * 1000; // ms -constexpr int64_t TWO_MINUTES_MS = 120 * 1000; // ms constexpr const char* CANCEL_UNLOAD = "cancelUnload"; constexpr const char* KEY_EVENT_ID = "eventId"; constexpr const char* KEY_NAME = "name"; @@ -1423,37 +1422,28 @@ int32_t SystemAbilityStateScheduler::CheckStopEnableOnce(const OnDemandEvent& ev return result; } -bool SystemAbilityStateScheduler::GetIdleProcessInfo(int32_t systemAbilityId, IdleProcessInfo& idleProcessInfo) +int64_t SystemAbilityStateScheduler::GetsystemAbilityIdleTime(int32_t systemAbilityId, IdleProcessInfo& idleProcessInfo) { std::shared_ptr abilityContext; if (!GetSystemAbilityContext(systemAbilityId, abilityContext)) { - return false; + return -1; } std::lock_guard autoLock(abilityContext->ownProcessContext->processLock); - if (abilityContext->state != SystemAbilityState::UNLOADABLE || - abilityContext->ownProcessContext->state == SystemProcessState::NOT_STARTED) { - HILOGD("GetIdleProcessInfo SA:%{public}d state not idle or proc not started", systemAbilityId); - return false; - } - int64_t lastStopTime = abilityContext->ownProcessContext->lastStopTime; - if (lastStopTime != -1 && (GetTickCount() - lastStopTime < TWO_MINUTES_MS)) { - HILOGD("GetIdleProcessInfo SA:%{public}d lastStopTime less than 2 min", systemAbilityId); - return false; - } - idleProcessInfo.processName = abilityContext->ownProcessContext->processName; - idleProcessInfo.pid = abilityContext->ownProcessContext->pid; - idleProcessInfo.lastIdleTime = abilityContext->lastIdleTime; - return true; + return abilityContext->lastIdleTime; } -bool SystemAbilityStateScheduler::IsSystemProcessCanUnload(const std::u16string& processName) +bool SystemAbilityStateScheduler::GetLruIdleSystemAbilityInfo(int32_t systemAbilityId, std::u16string& processName, + int64_t& lastStopTime, int32_t& pid) { - std::shared_ptr processContext; - if (!GetSystemProcessContext(processName, processContext)) { + std::shared_ptr abilityContext; + if (!GetSystemAbilityContext(systemAbilityId, abilityContext)) { return false; } - std::lock_guard autoLock(processContext->processLock); - return CanUnloadAllSystemAbilityLocked(processContext); + std::lock_guard autoLock(abilityContext->ownProcessContext->processLock); + processName = abilityContext->ownProcessContext->processName; + pid = abilityContext->ownProcessContext->pid; + lastStopTime - abilityContext->ownProcessContext->lastStopTime; + return true; } void SystemAbilityStateScheduler::UnloadEventHandler::ProcessEvent(uint32_t eventId) -- Gitee From 0f458d17d77c0bd5a3f3b7e8dc09d428e4aa524d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 13:04:33 +0000 Subject: [PATCH 16/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../test/unittest/src/system_ability_mgr_util_test.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp index 18c3cb39..2f7c7978 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp @@ -443,7 +443,7 @@ HWTEST_F(SamgrUtilTest, TestGetFilesByPriority002, TestSize.Level3) delete mockCfgFiles; } -#iddef SUPPORT_PENGLAI_MODE +#ifdef SUPPORT_PENGLAI_MODE /** * @tc.name: InitPenglaiFunc001 * @tc.desc: test InitPenglaiFunc @@ -463,8 +463,9 @@ HWTEST_F(SamgrUtilTest, InitPenglaiFunc001, TestSize.Level3) */ HWTEST_F(SamgrUtilTest, CheckPenglaiPermission001, TestSize.Level3) { - system::penglaiFunc_ = PENG_LAI; - bool ret = SamgrUtil::CheckPenglaiPermission(1); + SamgrUtil::penglaiFunc_ = nullptr; + bool ret = SamgrUtil::CheckPengLaiPermission(1); EXPECT_TRUE(ret); } +#endif } \ No newline at end of file -- Gitee From f47eb743c77fcd65be97594801ef3cf996ef7fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 13:07:06 +0000 Subject: [PATCH 17/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../native/test/unittest/src/mock_penglai_service_client.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp b/services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp index dd4c6333..9d42b930 100644 --- a/services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp +++ b/services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp @@ -19,8 +19,6 @@ namespace OHOS { namespace Penglai { -bool permissionRet = true; -PenglaiServiceClient::PenglaiServiceClient() { } -- Gitee From 7a9527f216b449d7838a0edb3f7bea9933c48979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 13:07:43 +0000 Subject: [PATCH 18/26] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20se?= =?UTF-8?q?rvices/samgr/native/test/unittest/src/mock=5Fpenglai=5Fservice?= =?UTF-8?q?=5Fclient.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/mock_penglai_service_client.cpp | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp diff --git a/services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp b/services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp deleted file mode 100644 index 9d42b930..00000000 --- a/services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef SUPPORT_PENGLAI_MODE -#include "penglai_service_client.h" - -namespace OHOS { -namespace Penglai { - -{ -} - -PenglaiServiceClient::~PenglaiServiceClient() -{ -} - -bool PenglaiServiceClient::IsLaunchAllowedByUid(const int32_t &callerUid, const int32_t &systemAbilityId) -{ - return permissionRet; -} -} // namespace Penglai -} // namespace OHOS -#endif //SUPPORT_PENGLAI_MODE \ No newline at end of file -- Gitee From c2f4175d0fa10322e76fc9123dadf3e16f9873e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 13:12:24 +0000 Subject: [PATCH 19/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../src/system_ability_mgr_stub_test.cpp | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_stub_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_stub_test.cpp index 54be0331..5024627f 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_stub_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_stub_test.cpp @@ -28,6 +28,7 @@ #define private public #include "sa_status_change_mock.h" #include "system_ability_manager.h" +#include "system_ability_manager_util.h" using namespace std; using namespace testing; @@ -51,18 +52,13 @@ bool MockIsLaunchAllowedByUid(const int32_t callingUid, const int32_t systemAbil return g_permissionRet; } -void SetpenglaiPerm(bool permission) +void SetPenglaiPerm(bool permission) { SamgrUtil::penglaiFunc_ = (void*)MockIsLaunchAllowedByUid; g_permissionRet = permission; } -void UnSetpenglaiPerm() -{ - SamgrUtil::penglaiFunc_ = g_originHandle; -} - -void UnSetpenglaiPerm() +void UnSetPenglaiPerm() { SamgrUtil::penglaiFunc_ = g_originHandle; } @@ -591,10 +587,10 @@ HWTEST_F(SystemAbilityMgrStubTest, CheckSystemAbilityImmeInner004, TestSize.Leve data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission denied - SetpenglaiPerm(false); + SetPenglaiPerm(false); int32_t result = saMgr->CheckSystemAbilityImmeInner(data, reply); EXPECT_EQ(result, ERR_PERMISSION_DENIED); - UnSetpenglaiPerm(); + UnSetPenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -614,10 +610,10 @@ HWTEST_F(SystemAbilityMgrStubTest, CheckSystemAbilityImmeInner005, TestSize.Leve data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission true - SetpenglaiPerm(true); + SetPenglaiPerm(true); int32_t result = saMgr->CheckSystemAbilityImmeInner(data, reply); EXPECT_NE(result, ERR_PERMISSION_DENIED); - UnSetpenglaiPerm(); + UnSetPenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -652,10 +648,10 @@ HWTEST_F(SystemAbilityMgrStubTest, GetSystemAbilityInner002, TestSize.Level3) data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission denied - SetpenglaiPerm(false); + SetPenglaiPerm(false); int32_t result = saMgr->GetSystemAbilityInner(data, reply); EXPECT_EQ(result, ERR_PERMISSION_DENIED); - UnSetpenglaiPerm(); + UnSetPenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -675,10 +671,10 @@ HWTEST_F(SystemAbilityMgrStubTest, GetSystemAbilityInner003, TestSize.Level3) data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission true - SetpenglaiPerm(true); + SetPenglaiPerm(true); int32_t result = saMgr->GetSystemAbilityInner(data, reply); EXPECT_NE(result, ERR_PERMISSION_DENIED); - UnSetpenglaiPerm(); + UnSetPenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -713,10 +709,10 @@ HWTEST_F(SystemAbilityMgrStubTest, CheckSystemAbilityInner002, TestSize.Level3) data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission denied - SetpenglaiPerm(false); + SetPenglaiPerm(false); int32_t result = saMgr->CheckSystemAbilityInner(data, reply); EXPECT_EQ(result, ERR_PERMISSION_DENIED); - UnSetpenglaiPerm(); + UnSetPenglaiPerm(); saMgr->SetPengLai(false); } #endif @@ -736,10 +732,10 @@ HWTEST_F(SystemAbilityMgrStubTest, CheckSystemAbilityInner003, TestSize.Level3) data.WriteInt32(SAID); saMgr->SetPengLai(true); // set permission true - SetpenglaiPerm(true); + SetPenglaiPerm(true); int32_t result = saMgr->CheckSystemAbilityInner(data, reply); EXPECT_NE(result, ERR_PERMISSION_DENIED); - UnSetpenglaiPerm(); + UnSetPenglaiPerm(); saMgr->SetPengLai(false); } #endif -- Gitee From db9fdc55edb1c87b478875dcd7d24aebae07b007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 13:17:21 +0000 Subject: [PATCH 20/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- services/samgr/native/source/system_ability_manager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/samgr/native/source/system_ability_manager.cpp b/services/samgr/native/source/system_ability_manager.cpp index 8e6dbc80..97b6c736 100644 --- a/services/samgr/native/source/system_ability_manager.cpp +++ b/services/samgr/native/source/system_ability_manager.cpp @@ -84,7 +84,7 @@ constexpr int64_t CHECK_LOADED_DELAY_TIME = 4 * 1000; // ms #endif constexpr int32_t SOFTBUS_SERVER_SA_ID = 4700; constexpr int32_t FIRST_DUMP_INDEX = 0; -constexpr int32_t TWO_MINUTES_SECONDS = 120 * 1000; // ms +constexpr int64_t TWO_MINUTES_SECONDS = 120 * 1000; // ms } samgr::mutex SystemAbilityManager::instanceLock; @@ -1748,18 +1748,19 @@ int32_t SystemAbilityManager::GetLruIdleSystemAbilityProc(std::vector saIds = collectManager_->GetLowMemPrepareList(); std::map procInfos; + std::set activeProcess; for (const auto& saId : saIds) { IdleProcessInfo info; int64_t lastStopTime = -1; if (!abilityStateScheduler_->GetLruIdleSystemAbilityInfo(saId, info.processName, lastStopTime, info.pid)) { continue; } - info.lastIdleTime = ailityStateScheduler_->GetSystemAbilityInfo(saId); - if(info.lastIdleTime < 0) { + info.lastIdleTime = abilityStateScheduler_->GetSystemAbilityIdleTime(saId); + if (info.lastIdleTime < 0) { activeProcess.insert(info.processName); continue; } - if (lastStop != -1 && (GetTickCount() - lastStopTime < TWO_MINUTES_SECONDS)) { + if (lastStopTime != -1 && (GetTickCount() - lastStopTime < TWO_MINUTES_SECONDS)) { continue; } auto procInfo = procInfos.find(info.processName); -- Gitee From 5dd5d7ea9da95f0bcd3d91b1ff9442ab9ec8693e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 7 Aug 2025 13:19:31 +0000 Subject: [PATCH 21/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../native/source/schedule/system_ability_state_scheduler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp index 88f89fe9..db8c03be 100644 --- a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp +++ b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp @@ -1422,7 +1422,7 @@ int32_t SystemAbilityStateScheduler::CheckStopEnableOnce(const OnDemandEvent& ev return result; } -int64_t SystemAbilityStateScheduler::GetsystemAbilityIdleTime(int32_t systemAbilityId, IdleProcessInfo& idleProcessInfo) +int64_t SystemAbilityStateScheduler::GetSystemAbilityIdleTime(int32_t systemAbilityId) { std::shared_ptr abilityContext; if (!GetSystemAbilityContext(systemAbilityId, abilityContext)) { @@ -1442,7 +1442,7 @@ bool SystemAbilityStateScheduler::GetLruIdleSystemAbilityInfo(int32_t systemAbil std::lock_guard autoLock(abilityContext->ownProcessContext->processLock); processName = abilityContext->ownProcessContext->processName; pid = abilityContext->ownProcessContext->pid; - lastStopTime - abilityContext->ownProcessContext->lastStopTime; + lastStopTime = abilityContext->ownProcessContext->lastStopTime; return true; } -- Gitee From b6834f352a8063096634d07885b69610c2bdd910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Fri, 8 Aug 2025 01:09:43 +0000 Subject: [PATCH 22/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../schedule/system_ability_state_scheduler.h | 2 +- .../unittest/src/system_ability_mgr_util_test.cpp | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/services/samgr/native/include/schedule/system_ability_state_scheduler.h b/services/samgr/native/include/schedule/system_ability_state_scheduler.h index d17ec6d8..cf75aa31 100644 --- a/services/samgr/native/include/schedule/system_ability_state_scheduler.h +++ b/services/samgr/native/include/schedule/system_ability_state_scheduler.h @@ -72,7 +72,7 @@ public: void UpdateLimitDelayUnloadTimeTask(int32_t systemAbilityId); int64_t GetSystemAbilityIdleTime(int32_t systemAbilityId); bool GetSystemAbilityIdleTime(int32_t systemAbilityId); - bool GetLruIdleSystemAbilityInfo(int32_t systemAbilityId , std::u16string& processName, int64_t& lastStopTime, + bool GetLruIdleSystemAbilityInfo(int32_t systemAbilityId, std::u16string& processName, int64_t& lastStopTime, int32_t& pid); private: void InitStateContext(const std::list& saProfiles); diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp index 2f7c7978..efc229d4 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp @@ -37,12 +37,11 @@ namespace system { const std::u16string PROCESS_NAME = u"test_process_name"; constexpr const char* PENG_LAI = "penglai"; -struct CfgFiles -{ +struct CfgFiles { const char* paths[MAX_CFG_POLICY_DIRS_CNT]; }; -CfgFiles* mockCfgFiles = nullptr; +CfgFiles* g_mockCfgFiles = nullptr; std::vector mockDirFiles; void InitSaMgr(sptr& saMgr) @@ -64,7 +63,7 @@ void GetDirFiles(const char* path, std::vector& files) CfgFiles* GetCfgFiles(const char* path) { - return mockCfgFiles; + return g_mockCfgFiles; } void SamgrUtilTest::SetUpTestCase() @@ -82,7 +81,7 @@ void SamgrUtilTest::SetUp() SamMockPermission::MockPermission(); system::mockValue = ""; mockDirFiles.clear(); - mockCfgFiles = nullptr; + g_mockCfgFiles = nullptr; DTEST_LOG << "SetUp" << std::endl; } @@ -434,13 +433,13 @@ HWTEST_F(SamgrUtilTest, TestGetFilesByPriority001, TestSize.Level3) HWTEST_F(SamgrUtilTest, TestGetFilesByPriority002, TestSize.Level3) { system::mockValue = ""; - mockCfgFiles = new CfgFiles(); + g_mockCfgFiles = new CfgFiles(); std::vector result; SamgrUtil::GetFilesByPriority("test_path", result); ASSERT_TRUE(result.empty()); - delete mockCfgFiles; + delete g_mockCfgFiles; } #ifdef SUPPORT_PENGLAI_MODE -- Gitee From e87e95132195ae967e1671679826336716d29ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Fri, 8 Aug 2025 01:12:10 +0000 Subject: [PATCH 23/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../innerkits/samgr_proxy/include/if_system_ability_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h b/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h index df81f033..4901a41a 100644 --- a/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h +++ b/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h @@ -240,7 +240,7 @@ public: } /** - * GetSystemProcessInfo, Get idle process info by said. + * GetSystemProcessInfo, Get process info by said. * only support for memmgrservice * * @param processList, Issue a parameter and return it as a result. -- Gitee From bd7cbaf0af9bdedabed3749bca214e07c4eefaf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Fri, 8 Aug 2025 01:58:54 +0000 Subject: [PATCH 24/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../native/test/unittest/src/system_ability_mgr_proxy_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp index 3a512aba..ccf3a3bb 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp @@ -1312,7 +1312,6 @@ HWTEST_F(SystemAbilityMgrProxyTest, UnloadProcess001, TestSize.Level1) EXPECT_EQ(res, ERR_OK); } - /** * @tc.name: GetLruIdleSystemAbilityProc001 * @tc.desc: GetLruIdleSystemAbilityProc -- Gitee From 9499a474c1f74d6087961abf68aed1c336f56cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Fri, 8 Aug 2025 02:01:47 +0000 Subject: [PATCH 25/26] daima MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- .../test/unittest/src/system_ability_mgr_util_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp index efc229d4..427b30f6 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_util_test.cpp @@ -456,11 +456,11 @@ HWTEST_F(SamgrUtilTest, InitPenglaiFunc001, TestSize.Level3) } /** - * @tc.name: CheckPenglaiPermission001 - * @tc.desc: test CheckPenglaiPermission + * @tc.name: CheckPengLaiPermission001 + * @tc.desc: test CheckPengLaiPermission * @tc.type: FUNC */ -HWTEST_F(SamgrUtilTest, CheckPenglaiPermission001, TestSize.Level3) +HWTEST_F(SamgrUtilTest, CheckPengLaiPermission001, TestSize.Level3) { SamgrUtil::penglaiFunc_ = nullptr; bool ret = SamgrUtil::CheckPengLaiPermission(1); -- Gitee From cddabf37d4853557ec33db3efac61b16aac366cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Fri, 8 Aug 2025 02:24:59 +0000 Subject: [PATCH 26/26] update bundle.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- bundle.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundle.json b/bundle.json index ca353215..2aace2aa 100644 --- a/bundle.json +++ b/bundle.json @@ -35,6 +35,8 @@ "c_utils", "common_event_service", "device_manager", + "dsoftbus", + "eventhandler", "ffrt", "hicollie", "hilog", -- Gitee