diff --git a/bundle.json b/bundle.json index e83679d2a517c9e040f470cf5beedd7570974392..2aace2aa93eb8c36a99c64225fb0930677ba284b 100644 --- a/bundle.json +++ b/bundle.json @@ -47,11 +47,10 @@ "json", "libxml2", "preferences", - "rust_cxx", "safwk", "selinux_adapter", "config_policy", - "ylong_runtime" + "rust_cxx" ] }, "build": { diff --git a/interfaces/innerkits/rust/tests/BUILD.gn b/interfaces/innerkits/rust/tests/BUILD.gn index 8746daed7d8bc3628ac864ca58a289edd9350af2..ed4d31d2c187428cf85f23224f4738e6e1f92ae5 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/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h b/interfaces/innerkits/samgr_proxy/include/if_system_ability_manager.h index e794e80bfd3c0c668c59b4552f12a29ce82fa5c9..df81f0332b3ee2ff3f470f24a9b074b742d507d7 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 d0691d80da4991944e965f8225c940cef245f264..270fdb7b4cfd12cb21e1b46ae64def87a403cb64 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 22aa551d8867fb01f38531b822783e0f8188b730..d79a7e9a08efcea6ac99ea3017c830a36468123d 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: *; }; diff --git a/services/dfx/source/hisysevent_adapter.cpp b/services/dfx/source/hisysevent_adapter.cpp index 72c3629a018de54e0b04d1f96f139141cc7428de..c4f0e3f0588fd7cffc649241a67169aaab6b3a83 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/services/samgr/native/include/schedule/system_ability_state_scheduler.h b/services/samgr/native/include/schedule/system_ability_state_scheduler.h index 6a727747fa979d85b934d5b886cb1f57647c225e..fcd3626c804671bde182aff7ecf8da368ec6af4f 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,9 @@ 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 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_stub.h b/services/samgr/native/include/system_ability_manager_stub.h index 92187c64d282afbda566b6174cee303178869948..25508b3c14048dc3d0729dd426a28f346b58e066 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/include/system_ability_manager_util.h b/services/samgr/native/include/system_ability_manager_util.h index 938b7ac0fde71b6f7e45555cc9a10b3b6cbf3e73..df8855d5961ee7de33a63a0ca1bb619b15c1bc79 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 f0662a553a5a470e9aa8f26e6bad6d9ddeab37f9..db8c03bec1ea6d7e08e1db79d07e9dbe5aa5d58f 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) { 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) diff --git a/services/samgr/native/source/system_ability_manager.cpp b/services/samgr/native/source/system_ability_manager.cpp index 4ec3f076fec55a0e2ab7ef372f2ca214d2cfb3af..97b6c73620fb51fbf1a12a436345273b584c037f 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 int64_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); @@ -1747,9 +1748,19 @@ int32_t SystemAbilityManager::GetLruIdleSystemAbilityProc(std::vector saIds = collectManager_->GetLowMemPrepareList(); std::map procInfos; + std::set activeProcess; 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 = abilityStateScheduler_->GetSystemAbilityIdleTime(saId); + if (info.lastIdleTime < 0) { + activeProcess.insert(info.processName); + continue; + } + if (lastStopTime != -1 && (GetTickCount() - lastStopTime < TWO_MINUTES_SECONDS)) { continue; } auto procInfo = procInfos.find(info.processName); @@ -1760,9 +1771,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) { diff --git a/services/samgr/native/source/system_ability_manager_stub.cpp b/services/samgr/native/source/system_ability_manager_stub.cpp index 46611c6584feb55991910c4fd8d069de7251e1ca..290377d5962f0a2d9d87b203aa571d8ec427056d 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()); diff --git a/services/samgr/native/source/system_ability_manager_util.cpp b/services/samgr/native/source/system_ability_manager_util.cpp index 1f0ad3ba9633f45ddd77ecaea5dd9552bbbf4f01..31ebd1e20eb66ddf4606efff43be871d48383057 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()) { 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 3d8d959987f618f94eb082a4f2a8ee2f22fcebfc..2a61f87635bbd24082121459c0c992291eb0cfb1 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; } 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 ca2d55de285363f572f1d6ccf1b621fdec8269b2..0656f2e05e7bac3770b00b4d8f0a7cc9f4b1b056 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 1cadd1230c741ea0576f1ac7fc827a927568190c..89b11bee18f56d15e6b82842c57371a2a688c736 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); 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 dd4c6333c8ee3991901aa20a9436fe522cfc2a67..0000000000000000000000000000000000000000 --- a/services/samgr/native/test/unittest/src/mock_penglai_service_client.cpp +++ /dev/null @@ -1,37 +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 { - -bool permissionRet = true; -PenglaiServiceClient::PenglaiServiceClient() -{ -} - -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 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 a9a1094912db15bb6163ef3280bee3b8ce3399a0..3007aeb1a6ae78fbdbcdc9a8546e4192856bfc6b 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 153125a3cb281a1ebeaec7908e6fccc979731a22..87454cc0da5484b6f5562318c7e5924e7f8cd21f 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(); 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 dc33f42fe6d786e13828c67b9aba16e9de415ff6..3a512abae6899e9f617f360db818830af088892d 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; 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 bb43b9c57eb4ba33a278e763c70b3fbbdfc4bf97..7435edddc7fd1cd2ec858d4c3e3934b738f56dd9 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() 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 07c8189c34b0ac4aad65341578d4911ebac258ca..5024627fa54e60e25df3c9a502e5a6e9820e13c2 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; @@ -44,9 +45,22 @@ 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; } #endif @@ -573,9 +587,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 +610,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 +648,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 +671,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 +709,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 +732,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 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 d17794e4b608f950cb15796eed43cad07bbdebd2..b55af14bbf9e910ea6891abc39fd280dca6c8076 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()); } 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 8d5201a06bc0a037a9b5a598fad4f0d0f76c0179..2f7c7978c243221ed0b6bcae9851dc9677566cac 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,38 @@ 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; +} + +#ifdef 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) +{ + SamgrUtil::penglaiFunc_ = nullptr; + bool ret = SamgrUtil::CheckPengLaiPermission(1); + EXPECT_TRUE(ret); +} +#endif } \ 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 c55ace60605e0e9b20676ccbc0c60dd7f4cd97ab..67b7555a9d63bdf7a636ba07f5a4b04b5cc4f54a 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 19982e76ffcac9df155f44e538b474dc30b101b8..6998a8bf2e2826ca6467b020a3b35101a7d776a0 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 } } diff --git a/test/fuzztest/samgr_fuzzer/BUILD.gn b/test/fuzztest/samgr_fuzzer/BUILD.gn index f72c43a5996e0ba330234540dce90cd39bf7d9c6..8e9e07f8a4574d8abef98b52c9ad063627b79898 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"] diff --git a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn index 58dd770f7d8cce8aeca7a0a5cdf15ba405804415..e44b7bab243e74e16d90bd7980901c50290f3aec 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 536b4818c05e7608912b41eda56fb602c38a15d5..a4884847e43aea75700a63e7315bd35577274f37 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 9c9a24aa880c2d3f583c5d47da52319c26bf2102..021bffdaf04143e769f452a747bd6936337c38fe 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"]