From b97f1d813cf17e09b2d22cc7df082667e25b7a33 Mon Sep 17 00:00:00 2001 From: xuyong Date: Sat, 8 Mar 2025 09:32:53 +0800 Subject: [PATCH 01/25] build: add direct dependency of hisysevent:libhisysevent Signed-off-by: xuyong --- services/samgr/native/test/unittest/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/samgr/native/test/unittest/BUILD.gn b/services/samgr/native/test/unittest/BUILD.gn index a76daa2d..d1db2906 100644 --- a/services/samgr/native/test/unittest/BUILD.gn +++ b/services/samgr/native/test/unittest/BUILD.gn @@ -501,6 +501,7 @@ ohos_unittest("SystemAbilityMgrProxyTest") { "c_utils:utils", "googletest:gtest_main", "hilog:libhilog", + "hisysevent:libhisysevent", "init:libbegetutil", "ipc:ipc_single", "json:nlohmann_json_static", @@ -542,6 +543,7 @@ ohos_unittest("LocalAbilityManagerProxyTest") { "c_utils:utils", "googletest:gtest_main", "hilog:libhilog", + "hisysevent:libhisysevent", "ipc:ipc_single", "json:nlohmann_json_static", ] -- Gitee From 5f613e3810dced94ea9737535c1878a80c73d11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Thu, 13 Mar 2025 20:27:11 +0800 Subject: [PATCH 02/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/BUILD.gn | 6 + .../dynamic_cache/include/dynamic_cache.h | 104 ++-------------- .../dynamic_cache/src/dynamic_cache.cpp | 116 ++++++++++++++++++ .../native/include/system_ability_manager.h | 8 +- .../source/collect/common_event_collect.cpp | 1 + .../collect/device_status_collect_manager.cpp | 2 +- .../system_ability_state_scheduler.cpp | 8 +- test/fuzztest/samgr_fuzzer/BUILD.gn | 2 +- .../samgr_fuzzer/src/fuzztest_utils.cpp | 1 + test/fuzztest/samgrcoverage_fuzzer/BUILD.gn | 2 +- .../samgrcoverage_fuzzer.cpp | 10 +- test/fuzztest/samgrdumper_fuzzer/BUILD.gn | 2 +- .../systemabilitymanager_fuzzer/BUILD.gn | 2 +- .../systemabilitymanager_fuzzer.cpp | 1 + 14 files changed, 151 insertions(+), 114 deletions(-) create mode 100644 interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp diff --git a/interfaces/innerkits/dynamic_cache/BUILD.gn b/interfaces/innerkits/dynamic_cache/BUILD.gn index 38d8adf8..25650ef7 100644 --- a/interfaces/innerkits/dynamic_cache/BUILD.gn +++ b/interfaces/innerkits/dynamic_cache/BUILD.gn @@ -29,6 +29,12 @@ ohos_shared_library("dynamic_cache") { blocklist = "../../../cfi_blocklist.txt" } branch_protector_ret = "pac_ret" + sources = [ + "./src/dynamic_cache.cpp", + ] + configs = [ + "../samgr_proxy:samgr_proxy_config", + ] all_dependent_configs = [ ":dynamic_cache_config" ] public_configs = [ ":dynamic_cache_config" ] diff --git a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h index 513a88ba..5ebf122d 100644 --- a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h +++ b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h @@ -18,107 +18,19 @@ #include #include -#include - -#include "datetime_ex.h" #include "iremote_object.h" -#include "parameter.h" -#include "refbase.h" -#include "sam_log.h" -#include "sysparam_errno.h" namespace OHOS { using namespace std; class DynamicCache : public IRemoteObject::DeathRecipient { public: - void OnRemoteDied(const wptr& remote) override - { - HILOGD("DynamicCache OnRemoteDied called"); - ClearCache(); - } - sptr QueryResult(int32_t querySaId, int32_t code) - { - int32_t waterLineLength = 128; - char waterLine[128] = {0}; - string defaultValue = "default"; - GetParameter(key_.c_str(), defaultValue.c_str(), waterLine, waterLineLength); - { - std::lock_guard autoLock(queryCacheLock_); - if (CanUseCache(querySaId, waterLine, defaultValue)) { - HILOGD("DynamicCache QueryResult Return Cache %{public}d", querySaId); - return lastQuerySaProxy_; - } - } - HILOGD("DynamicCache QueryResult Recompute"); - sptr res = Recompute(querySaId, code); - if (res == nullptr) { - return nullptr; - } - { - std::lock_guard autoLock(queryCacheLock_); - localPara_[key_] = waterLine; - if (lastQuerySaProxy_ != nullptr) { - HILOGD("DynamicCache RemoveDeathRecipient"); - lastQuerySaProxy_->RemoveDeathRecipient(this); - } - lastQuerySaId_ = querySaId; - lastQuerySaProxy_ = res; - res->AddDeathRecipient(this); - } - return res; - } - - bool CanUseCache(int32_t querySaId, char* waterLine, string defaultValue) - { - return localPara_.count(key_) != 0 && lastQuerySaId_ == querySaId && - defaultValue != string(waterLine) && string(waterLine) == localPara_[key_] && - lastQuerySaProxy_ != nullptr && !lastQuerySaProxy_->IsObjectDead(); - } - - __attribute__((no_sanitize("cfi"))) - void ClearCache() - { - std::lock_guard autoLock(queryCacheLock_); - if (lastQuerySaProxy_ != nullptr) { - HILOGD("DynamicCache RemoveDeathRecipient"); - lastQuerySaProxy_->RemoveDeathRecipient(this); - } - lastQuerySaId_ = -1; - lastQuerySaProxy_ = nullptr; - } - - bool InvalidateCache() - { - HILOGD("DynamicCache InvalidateCache Begin"); - string tickCount = to_string(GetTickCount()); - int32_t ret = SetParameter(key_.c_str(), tickCount.c_str()); - if (ret != EC_SUCCESS) { - HILOGE("DynamicCache InvalidateCache SetParameter error:%{public}d!", ret); - return false; - } - HILOGD("DynamicCache InvalidateCache End"); - return true; - } - - bool SetKey(const string& key) - { - int32_t maxLength = 256; - if (key.size() == 0 || (int32_t)key.size() > maxLength) { - HILOGE("DynamicCache SetKey size error:%{public}zu!", key.size()); - return false; - } - key_ = key; - return true; - } - - virtual sptr Recompute(int32_t querySaId, int32_t code) - { - std::lock_guard autoLock(queryCacheLock_); - if (lastQuerySaId_ != querySaId) { - return nullptr; - } - return lastQuerySaProxy_; - } + void OnRemoteDied(const wptr& remote) override; + sptr QueryResult(int32_t querySaId, int32_t code); + bool CanUseCache(int32_t querySaId, char* waterLine, string defaultValue); + void ClearCache(); + bool InvalidateCache(); + bool SetKey(const string& key); + virtual sptr Recompute(int32_t querySaId, int32_t code); private: std::mutex queryCacheLock_; map localPara_; @@ -126,5 +38,5 @@ private: int32_t lastQuerySaId_; sptr lastQuerySaProxy_; }; -} +} // namespace OHOS #endif /* DYNAMIC_CACHE_H */ \ No newline at end of file diff --git a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp new file mode 100644 index 00000000..7c6c0c09 --- /dev/null +++ b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2023 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. + */ + +#include "dynamic_cache.h" + +#include "datetime_ex.h" +#include "parameter.h" +#include "refbase.h" +#include "sam_log.h" +#include "sysparam_errno.h" + +using namespace std; +namespace OHOS { + +void OnRemoteDied(const wptr& remote) override +{ + HILOGD("DynamicCache OnRemoteDied called"); + ClearCache(); +} + +sptr QueryResult(int32_t querySaId, int32_t code) +{ + int32_t waterLineLength = 128; + char waterLine[128] = {0}; + string defaultValue = "default"; + GetParameter(key_.c_str(), defaultValue.c_str(), waterLine, waterLineLength); + { + std::lock_guard autoLock(queryCacheLock_); + if (CanUseCache(querySaId, waterLine, defaultValue)) { + HILOGD("DynamicCache QueryResult Return Cache %{public}d", querySaId); + return lastQuerySaProxy_; + } + } + HILOGD("DynamicCache QueryResult Recompute"); + sptr res = Recompute(querySaId, code); + if (res == nullptr) { + return nullptr; + } + { + std::lock_guard autoLock(queryCacheLock_); + localPara_[key_] = waterLine; + if (lastQuerySaProxy_ != nullptr) { + HILOGD("DynamicCache RemoveDeathRecipient"); + lastQuerySaProxy_->RemoveDeathRecipient(this); + } + lastQuerySaId_ = querySaId; + lastQuerySaProxy_ = res; + res->AddDeathRecipient(this); + } + return res; +} + +bool CanUseCache(int32_t querySaId, char* waterLine, string defaultValue) +{ + return localPara_.count(key_) != 0 && lastQuerySaId_ == querySaId && + defaultValue != string(waterLine) && string(waterLine) == localPara_[key_] && + lastQuerySaProxy_ != nullptr && !lastQuerySaProxy_->IsObjectDead(); +} + +void __attribute__((no_sanitize("cfi"))) DynamicCache::ClearCache() +{ + std::lock_guard autoLock(queryCacheLock_); + if (lastQuerySaProxy_ != nullptr) { + HILOGD("DynamicCache RemoveDeathRecipient"); + lastQuerySaProxy_->RemoveDeathRecipient(this); + } + lastQuerySaId_ = -1; + lastQuerySaProxy_ = nullptr; +} + +bool DynamicCache::InvalidateCache() +{ + HILOGD("DynamicCache InvalidateCache Begin"); + string tickCount = to_string(GetTickCount()); + int32_t ret = SetParameter(key_.c_str(), tickCount.c_str()); + if (ret != EC_SUCCESS) { + HILOGE("DynamicCache InvalidateCache SetParameter error:%{public}d!", ret); + return false; + } + HILOGD("DynamicCache InvalidateCache End"); + return true; +} + +bool DynamicCache::SetKey(const string& key) +{ + int32_t maxLength = 256; + if (key.size() == 0 || (int32_t)key.size() > maxLength) { + HILOGE("DynamicCache SetKey size error:%{public}zu!", key.size()); + return false; + } + key_ = key; + return true; +} + +virtual sptr DynamicCache::Recompute(int32_t querySaId, int32_t code) +{ + std::lock_guard autoLock(queryCacheLock_); + if (lastQuerySaId_ != querySaId) { + return nullptr; + } + return lastQuerySaProxy_; +} +} // namespace OHOS + diff --git a/services/samgr/native/include/system_ability_manager.h b/services/samgr/native/include/system_ability_manager.h index f4c672d4..833f3eac 100644 --- a/services/samgr/native/include/system_ability_manager.h +++ b/services/samgr/native/include/system_ability_manager.h @@ -283,7 +283,7 @@ private: void DoInsertSaData(const std::u16string& name, const sptr& ability, const SAExtraProp& extraProp); int32_t StartOnDemandAbility(int32_t systemAbilityId, bool& isExist) { - lock_guard onDemandAbilityLock(onDemandLock_); + std::lock_guard onDemandAbilityLock(onDemandLock_); return StartOnDemandAbilityLocked(systemAbilityId, isExist); } int32_t StartOnDemandAbilityLocked(int32_t systemAbilityId, bool& isExist); @@ -296,7 +296,7 @@ private: void InitSaProfile(); bool GetSaProfile(int32_t saId, CommonSaProfile& saProfile) { - lock_guard autoLock(saProfileMapLock_); + std::lock_guard autoLock(saProfileMapLock_); auto iter = saProfileMap_.find(saId); if (iter == saProfileMap_.end()) { return false; @@ -324,7 +324,7 @@ private: const OnDemandEvent& event); void StartOnDemandAbility(const std::u16string& name, int32_t systemAbilityId) { - lock_guard autoLock(onDemandLock_); + std::lock_guard autoLock(onDemandLock_); StartOnDemandAbilityLocked(name, systemAbilityId); } void StartOnDemandAbilityLocked(const std::u16string& name, int32_t systemAbilityId); @@ -333,7 +333,7 @@ private: int32_t StartDynamicSystemProcess(const std::u16string& name, int32_t systemAbilityId, const OnDemandEvent& event); bool StopOnDemandAbility(const std::u16string& name, int32_t systemAbilityId, const OnDemandEvent& event) { - lock_guard autoLock(onDemandLock_); + std::lock_guard autoLock(onDemandLock_); return StopOnDemandAbilityInner(name, systemAbilityId, event); } bool StopOnDemandAbilityInner(const std::u16string& name, int32_t systemAbilityId, const OnDemandEvent& event); diff --git a/services/samgr/native/source/collect/common_event_collect.cpp b/services/samgr/native/source/collect/common_event_collect.cpp index df9693de..f1349b12 100644 --- a/services/samgr/native/source/collect/common_event_collect.cpp +++ b/services/samgr/native/source/collect/common_event_collect.cpp @@ -17,6 +17,7 @@ #include "common_event_collect.h" +#include "datetime_ex.h" #include "ability_death_recipient.h" #include "system_ability_manager_util.h" #include "common_event_manager.h" diff --git a/services/samgr/native/source/collect/device_status_collect_manager.cpp b/services/samgr/native/source/collect/device_status_collect_manager.cpp index 0ab4559e..66118b7d 100644 --- a/services/samgr/native/source/collect/device_status_collect_manager.cpp +++ b/services/samgr/native/source/collect/device_status_collect_manager.cpp @@ -552,7 +552,7 @@ void DeviceStatusCollectManager::StringToTypeAndSaid(const std::string& eventStr HILOGW("StringToTypeAndSaid failed"); return; } - if (pos == string::npos) { + if (pos == std::string::npos) { HILOGW("StringToSaid failed"); return; } 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 1c20f943..ab45a062 100644 --- a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp +++ b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp @@ -1325,7 +1325,7 @@ int32_t SystemAbilityStateScheduler::CheckStartEnableOnce(const OnDemandEvent& e { int32_t result = ERR_INVALID_VALUE; if (saControl.enableOnce) { - lock_guard autoLock(startEnableOnceLock_); + std::lock_guard autoLock(startEnableOnceLock_); auto iter = startEnableOnceMap_.find(saControl.saId); if (iter != startEnableOnceMap_.end() && SamgrUtil::IsSameEvent(event, startEnableOnceMap_[saControl.saId])) { HILOGI("ondemand canceled for enable-once, ondemandId:%{public}d, SA:%{public}d", @@ -1340,7 +1340,7 @@ int32_t SystemAbilityStateScheduler::CheckStartEnableOnce(const OnDemandEvent& e LoadRequestInfo loadRequestInfo = {LOCAL_DEVICE, callback, saControl.saId, callingPid, event}; result = HandleLoadAbilityEvent(loadRequestInfo); if (saControl.enableOnce && result != ERR_OK) { - lock_guard autoLock(startEnableOnceLock_); + std::lock_guard autoLock(startEnableOnceLock_); auto& events = startEnableOnceMap_[saControl.saId]; events.remove(event); if (events.empty()) { @@ -1361,7 +1361,7 @@ int32_t SystemAbilityStateScheduler::CheckStopEnableOnce(const OnDemandEvent& ev { int32_t result = ERR_INVALID_VALUE; if (saControl.enableOnce) { - lock_guard autoLock(stopEnableOnceLock_); + std::lock_guard autoLock(stopEnableOnceLock_); auto iter = stopEnableOnceMap_.find(saControl.saId); if (iter != stopEnableOnceMap_.end() && SamgrUtil::IsSameEvent(event, stopEnableOnceMap_[saControl.saId])) { HILOGI("ondemand canceled for enable-once, ondemandId:%{public}d, SA:%{public}d", @@ -1377,7 +1377,7 @@ int32_t SystemAbilityStateScheduler::CheckStopEnableOnce(const OnDemandEvent& ev std::make_shared(event, saControl.saId, callingPid); result = HandleUnloadAbilityEvent(unloadRequestInfo); if (saControl.enableOnce && result != ERR_OK) { - lock_guard autoLock(stopEnableOnceLock_); + std::lock_guard autoLock(stopEnableOnceLock_); auto& events = stopEnableOnceMap_[saControl.saId]; events.remove(event); if (events.empty()) { diff --git a/test/fuzztest/samgr_fuzzer/BUILD.gn b/test/fuzztest/samgr_fuzzer/BUILD.gn index a9aac270..a35ce61b 100644 --- a/test/fuzztest/samgr_fuzzer/BUILD.gn +++ b/test/fuzztest/samgr_fuzzer/BUILD.gn @@ -167,7 +167,7 @@ foreach(item, samgr_fuzztests) { "src/fuzztest_utils.cpp", item.source, ] - deps = [] + deps = ["//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache"] external_deps = [ "access_token:libaccesstoken_sdk", diff --git a/test/fuzztest/samgr_fuzzer/src/fuzztest_utils.cpp b/test/fuzztest/samgr_fuzzer/src/fuzztest_utils.cpp index 5733e4a9..325fc4f4 100644 --- a/test/fuzztest/samgr_fuzzer/src/fuzztest_utils.cpp +++ b/test/fuzztest/samgr_fuzzer/src/fuzztest_utils.cpp @@ -15,6 +15,7 @@ #include "fuzztest_utils.h" +#include "datetime_ex.h" #include "if_system_ability_manager.h" #include "sam_mock_permission.h" #include "system_ability_manager.h" diff --git a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn index f082e2c6..b801d6a8 100644 --- a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn @@ -70,7 +70,7 @@ ohos_fuzztest("SamgrCoverageFuzzTest") { "${samgr_services_dir}/test/unittest/src/sa_status_change_mock.cpp", "samgrcoverage_fuzzer.cpp", ] - deps = [] + deps = ["//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache"] external_deps = [ "access_token:libaccesstoken_sdk", diff --git a/test/fuzztest/samgrcoverage_fuzzer/samgrcoverage_fuzzer.cpp b/test/fuzztest/samgrcoverage_fuzzer/samgrcoverage_fuzzer.cpp index 5f9d24d6..3463ff5c 100644 --- a/test/fuzztest/samgrcoverage_fuzzer/samgrcoverage_fuzzer.cpp +++ b/test/fuzztest/samgrcoverage_fuzzer/samgrcoverage_fuzzer.cpp @@ -106,12 +106,12 @@ void FuzzRemoveSystemProcess(const uint8_t* data, size_t size) ++count; saMgr->UnSubscribeSystemAbility(callback->AsObject()); - u16string name = u"test"; - string srcDeviceId = "srcDeviceId"; + std::u16string name = u"test"; + std::string srcDeviceId = "srcDeviceId"; saMgr->startingProcessMap_.clear(); sptr callbackOne = new SystemAbilityLoadCallbackMock(); SystemAbilityManager::AbilityItem abilityItem; - abilityItem.callbackMap[srcDeviceId].push_back(make_pair(callbackOne, SAID)); + abilityItem.callbackMap[srcDeviceId].push_back(std::make_pair(callbackOne, SAID)); saMgr->startingAbilityMap_[SAID] = abilityItem; saMgr->CleanCallbackForLoadFailed(SAID, name, srcDeviceId, callbackOne); } @@ -125,7 +125,7 @@ void FuzzNotifySystemAbilityLoaded(const uint8_t* data, size_t size) sptr callback = new SystemAbilityLoadCallbackMock(); sptr remoteObject = new TestTransactionService(); saMgr->NotifySystemAbilityLoaded(SAID, remoteObject, callback); - string srcDeviceId = "srcDeviceId"; + std::string srcDeviceId = "srcDeviceId"; FuzzedDataProvider fdp(data, size); int32_t systemAbilityId = fdp.ConsumeIntegral(); saMgr->LoadSystemAbilityFromRpc(srcDeviceId, systemAbilityId, callback); @@ -150,7 +150,7 @@ void FuzzNotifySystemAbilityLoaded(const uint8_t* data, size_t size) saMgr->OnRemoteCallbackDied(mockLoadCallback2->AsObject()); sptr callback2 = new SystemAbilityLoadCallbackMock(); - list> callbacks; + std::list> callbacks; callbacks.push_back(callback2); saMgr->remoteCallbackDeath_ = sptr(new RemoteCallbackDeathRecipient()); saMgr->RemoveRemoteCallbackLocked(callbacks, callback2); diff --git a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn index 7ed1b8bc..2031619f 100644 --- a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn @@ -69,7 +69,7 @@ ohos_fuzztest("SamgrDumperFuzzTest") { "${samgr_services_dir}/test/unittest/src/sa_status_change_mock.cpp", "samgrdumper_fuzzer.cpp", ] - deps = [] + deps = ["//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache"] external_deps = [ "access_token:libaccesstoken_sdk", diff --git a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn index e18e9483..a0508fbe 100644 --- a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn +++ b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn @@ -69,7 +69,7 @@ ohos_fuzztest("SystemAbilityManagerFuzzTest") { "//foundation/systemabilitymgr/samgr/services/samgr/native/test/unittest/src/mock_permission.cpp", "systemabilitymanager_fuzzer.cpp", ] - deps = [] + deps = ["//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache"] external_deps = [ "access_token:libaccesstoken_sdk", diff --git a/test/fuzztest/systemabilitymanager_fuzzer/systemabilitymanager_fuzzer.cpp b/test/fuzztest/systemabilitymanager_fuzzer/systemabilitymanager_fuzzer.cpp index c5dbcab0..0e84d4eb 100644 --- a/test/fuzztest/systemabilitymanager_fuzzer/systemabilitymanager_fuzzer.cpp +++ b/test/fuzztest/systemabilitymanager_fuzzer/systemabilitymanager_fuzzer.cpp @@ -15,6 +15,7 @@ #include "systemabilitymanager_fuzzer.h" +#include "datetime_ex.h" #include "if_system_ability_manager.h" #include "sam_mock_permission.h" #include "system_ability_manager.h" -- Gitee From 7949047dd8d2a31c61952489d4428133be46a956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Fri, 14 Mar 2025 10:53:41 +0800 Subject: [PATCH 03/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/BUILD.gn | 2 +- interfaces/innerkits/dynamic_cache/include/dynamic_cache.h | 5 ++--- interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/interfaces/innerkits/dynamic_cache/BUILD.gn b/interfaces/innerkits/dynamic_cache/BUILD.gn index 25650ef7..ebeca2cc 100644 --- a/interfaces/innerkits/dynamic_cache/BUILD.gn +++ b/interfaces/innerkits/dynamic_cache/BUILD.gn @@ -35,7 +35,6 @@ ohos_shared_library("dynamic_cache") { configs = [ "../samgr_proxy:samgr_proxy_config", ] - all_dependent_configs = [ ":dynamic_cache_config" ] public_configs = [ ":dynamic_cache_config" ] if (is_standard_system) { @@ -43,6 +42,7 @@ ohos_shared_library("dynamic_cache") { "c_utils:utils", "hilog:libhilog", "init:libbegetutil", + "ipc:ipc_core", ] } diff --git a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h index 5ebf122d..0fe2ed52 100644 --- a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h +++ b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h @@ -21,7 +21,6 @@ #include "iremote_object.h" namespace OHOS { -using namespace std; class DynamicCache : public IRemoteObject::DeathRecipient { public: void OnRemoteDied(const wptr& remote) override; @@ -33,8 +32,8 @@ public: virtual sptr Recompute(int32_t querySaId, int32_t code); private: std::mutex queryCacheLock_; - map localPara_; - string key_; + std::map localPara_; + std::string key_; int32_t lastQuerySaId_; sptr lastQuerySaProxy_; }; diff --git a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp index 7c6c0c09..c6329eca 100644 --- a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp +++ b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp @@ -113,4 +113,3 @@ virtual sptr DynamicCache::Recompute(int32_t querySaId, int32_t c return lastQuerySaProxy_; } } // namespace OHOS - -- Gitee From 35f5e09f5e49a543a520a608319b29e6e4db0c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Sat, 15 Mar 2025 17:36:17 +0800 Subject: [PATCH 04/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/BUILD.gn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interfaces/innerkits/dynamic_cache/BUILD.gn b/interfaces/innerkits/dynamic_cache/BUILD.gn index ebeca2cc..79f7dea3 100644 --- a/interfaces/innerkits/dynamic_cache/BUILD.gn +++ b/interfaces/innerkits/dynamic_cache/BUILD.gn @@ -45,7 +45,9 @@ ohos_shared_library("dynamic_cache") { "ipc:ipc_core", ] } - + innerapi_tags = [ + "chipsetsdk_indirect", + ] install_images = [ system_base_dir ] relative_install_dir = "chipset-pub-sdk" part_name = "samgr" -- Gitee From 9d3b7f76b35a5c36b832416374b572e4b16c96ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Mon, 17 Mar 2025 09:20:54 +0800 Subject: [PATCH 05/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/include/dynamic_cache.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h index 0fe2ed52..26b520dc 100644 --- a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h +++ b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h @@ -25,10 +25,10 @@ class DynamicCache : public IRemoteObject::DeathRecipient { public: void OnRemoteDied(const wptr& remote) override; sptr QueryResult(int32_t querySaId, int32_t code); - bool CanUseCache(int32_t querySaId, char* waterLine, string defaultValue); + bool CanUseCache(int32_t querySaId, char* waterLine, std::string defaultValue); void ClearCache(); bool InvalidateCache(); - bool SetKey(const string& key); + bool SetKey(const std::string& key); virtual sptr Recompute(int32_t querySaId, int32_t code); private: std::mutex queryCacheLock_; -- Gitee From 7e0e3cd047565cb721c4f220add609fdb6d6a2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Mon, 17 Mar 2025 11:56:50 +0800 Subject: [PATCH 06/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/include/dynamic_cache.h | 2 ++ interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h index 26b520dc..3aecf90e 100644 --- a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h +++ b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h @@ -18,9 +18,11 @@ #include #include +#include "datetime_ex.h" #include "iremote_object.h" namespace OHOS { +using namespace std; class DynamicCache : public IRemoteObject::DeathRecipient { public: void OnRemoteDied(const wptr& remote) override; diff --git a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp index c6329eca..3e432205 100644 --- a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp +++ b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp @@ -24,7 +24,7 @@ using namespace std; namespace OHOS { -void OnRemoteDied(const wptr& remote) override +void OnRemoteDied(const wptr& remote) { HILOGD("DynamicCache OnRemoteDied called"); ClearCache(); -- Gitee From 69ae6bc5a806a7391a4eae9621a1b573117aa5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Mon, 17 Mar 2025 17:03:44 +0800 Subject: [PATCH 07/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/BUILD.gn | 12 +++--------- .../innerkits/dynamic_cache/src/dynamic_cache.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/interfaces/innerkits/dynamic_cache/BUILD.gn b/interfaces/innerkits/dynamic_cache/BUILD.gn index 79f7dea3..dce41a63 100644 --- a/interfaces/innerkits/dynamic_cache/BUILD.gn +++ b/interfaces/innerkits/dynamic_cache/BUILD.gn @@ -29,12 +29,8 @@ ohos_shared_library("dynamic_cache") { blocklist = "../../../cfi_blocklist.txt" } branch_protector_ret = "pac_ret" - sources = [ - "./src/dynamic_cache.cpp", - ] - configs = [ - "../samgr_proxy:samgr_proxy_config", - ] + sources = [ "./src/dynamic_cache.cpp" ] + configs = [ "../samgr_proxy:samgr_proxy_config" ] all_dependent_configs = [ ":dynamic_cache_config" ] public_configs = [ ":dynamic_cache_config" ] if (is_standard_system) { @@ -45,9 +41,7 @@ ohos_shared_library("dynamic_cache") { "ipc:ipc_core", ] } - innerapi_tags = [ - "chipsetsdk_indirect", - ] + innerapi_tags = [ "chipsetsdk_indirect" ] install_images = [ system_base_dir ] relative_install_dir = "chipset-pub-sdk" part_name = "samgr" diff --git a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp index 3e432205..4cfa3e7e 100644 --- a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp +++ b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp @@ -24,13 +24,13 @@ using namespace std; namespace OHOS { -void OnRemoteDied(const wptr& remote) +void DynamicCache::OnRemoteDied(const wptr& remote) { HILOGD("DynamicCache OnRemoteDied called"); ClearCache(); } -sptr QueryResult(int32_t querySaId, int32_t code) +sptr DynamicCache::QueryResult(int32_t querySaId, int32_t code) { int32_t waterLineLength = 128; char waterLine[128] = {0}; @@ -62,7 +62,7 @@ sptr QueryResult(int32_t querySaId, int32_t code) return res; } -bool CanUseCache(int32_t querySaId, char* waterLine, string defaultValue) +bool DynamicCache::CanUseCache(int32_t querySaId, char* waterLine, string defaultValue) { return localPara_.count(key_) != 0 && lastQuerySaId_ == querySaId && defaultValue != string(waterLine) && string(waterLine) == localPara_[key_] && @@ -104,7 +104,7 @@ bool DynamicCache::SetKey(const string& key) return true; } -virtual sptr DynamicCache::Recompute(int32_t querySaId, int32_t code) +sptr DynamicCache::Recompute(int32_t querySaId, int32_t code) { std::lock_guard autoLock(queryCacheLock_); if (lastQuerySaId_ != querySaId) { -- Gitee From 3b0d7e50c6c5e1ee48540667d0267518fb90a577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Mon, 17 Mar 2025 17:19:26 +0800 Subject: [PATCH 08/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- test/fuzztest/samgr_fuzzer/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, 4 insertions(+), 4 deletions(-) diff --git a/test/fuzztest/samgr_fuzzer/BUILD.gn b/test/fuzztest/samgr_fuzzer/BUILD.gn index a35ce61b..26566694 100644 --- a/test/fuzztest/samgr_fuzzer/BUILD.gn +++ b/test/fuzztest/samgr_fuzzer/BUILD.gn @@ -167,7 +167,7 @@ foreach(item, samgr_fuzztests) { "src/fuzztest_utils.cpp", item.source, ] - deps = ["//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache"] + deps = [ "//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache" ] external_deps = [ "access_token:libaccesstoken_sdk", diff --git a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn index b801d6a8..db80705a 100644 --- a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn @@ -70,7 +70,7 @@ ohos_fuzztest("SamgrCoverageFuzzTest") { "${samgr_services_dir}/test/unittest/src/sa_status_change_mock.cpp", "samgrcoverage_fuzzer.cpp", ] - deps = ["//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache"] + deps = [ "//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache" ] external_deps = [ "access_token:libaccesstoken_sdk", diff --git a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn index 2031619f..1d6123d8 100644 --- a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn @@ -69,7 +69,7 @@ ohos_fuzztest("SamgrDumperFuzzTest") { "${samgr_services_dir}/test/unittest/src/sa_status_change_mock.cpp", "samgrdumper_fuzzer.cpp", ] - deps = ["//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache"] + deps = [ "//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache" ] external_deps = [ "access_token:libaccesstoken_sdk", diff --git a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn index a0508fbe..c5357e93 100644 --- a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn +++ b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn @@ -69,7 +69,7 @@ ohos_fuzztest("SystemAbilityManagerFuzzTest") { "//foundation/systemabilitymgr/samgr/services/samgr/native/test/unittest/src/mock_permission.cpp", "systemabilitymanager_fuzzer.cpp", ] - deps = ["//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache"] + deps = [ "//foundation/systemabilitymgr/samgr/interfaces/innerkits/dynamic_cache:dynamic_cache" ] external_deps = [ "access_token:libaccesstoken_sdk", -- Gitee From 8f1f476e987a3c6b77d246a1f5f651a4e24bb4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Tue, 18 Mar 2025 14:47:16 +0800 Subject: [PATCH 09/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- .../dynamic_cache/include/dynamic_cache.h | 32 +++++++++++++++++-- .../dynamic_cache/src/dynamic_cache.cpp | 9 ------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h index 3aecf90e..f4ad6f17 100644 --- a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h +++ b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h @@ -20,18 +20,44 @@ #include #include "datetime_ex.h" #include "iremote_object.h" +#include "sam_log.h" namespace OHOS { using namespace std; class DynamicCache : public IRemoteObject::DeathRecipient { public: - void OnRemoteDied(const wptr& remote) override; + + void OnRemoteDied(const wptr& remote) override + { + HILOGD("DynamicCache OnRemoteDied called"); + ClearCache(); + } + sptr QueryResult(int32_t querySaId, int32_t code); bool CanUseCache(int32_t querySaId, char* waterLine, std::string defaultValue); - void ClearCache(); + + void __attribute__((no_sanitize("cfi"))) ClearCache() + { + std::lock_guard autoLock(queryCacheLock_); + if (lastQuerySaProxy_ != nullptr) { + HILOGD("DynamicCache RemoveDeathRecipient"); + lastQuerySaProxy_->RemoveDeathRecipient(this); + } + lastQuerySaId_ = -1; + lastQuerySaProxy_ = nullptr; + } + bool InvalidateCache(); bool SetKey(const std::string& key); - virtual sptr Recompute(int32_t querySaId, int32_t code); + virtual sptr Recompute(int32_t querySaId, int32_t code) + { + std::lock_guard autoLock(queryCacheLock_); + if (lastQuerySaId_ != querySaId) { + return nullptr; + } + return lastQuerySaProxy_; + } + private: std::mutex queryCacheLock_; std::map localPara_; diff --git a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp index 4cfa3e7e..e9881883 100644 --- a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp +++ b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp @@ -103,13 +103,4 @@ bool DynamicCache::SetKey(const string& key) key_ = key; return true; } - -sptr DynamicCache::Recompute(int32_t querySaId, int32_t code) -{ - std::lock_guard autoLock(queryCacheLock_); - if (lastQuerySaId_ != querySaId) { - return nullptr; - } - return lastQuerySaProxy_; -} } // namespace OHOS -- Gitee From 64594f020748aae4ec7cef6598547a4629595bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Tue, 18 Mar 2025 15:05:00 +0800 Subject: [PATCH 10/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- .../dynamic_cache/src/dynamic_cache.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp index e9881883..805d5477 100644 --- a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp +++ b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp @@ -24,12 +24,6 @@ using namespace std; namespace OHOS { -void DynamicCache::OnRemoteDied(const wptr& remote) -{ - HILOGD("DynamicCache OnRemoteDied called"); - ClearCache(); -} - sptr DynamicCache::QueryResult(int32_t querySaId, int32_t code) { int32_t waterLineLength = 128; @@ -69,17 +63,6 @@ bool DynamicCache::CanUseCache(int32_t querySaId, char* waterLine, string defaul lastQuerySaProxy_ != nullptr && !lastQuerySaProxy_->IsObjectDead(); } -void __attribute__((no_sanitize("cfi"))) DynamicCache::ClearCache() -{ - std::lock_guard autoLock(queryCacheLock_); - if (lastQuerySaProxy_ != nullptr) { - HILOGD("DynamicCache RemoveDeathRecipient"); - lastQuerySaProxy_->RemoveDeathRecipient(this); - } - lastQuerySaId_ = -1; - lastQuerySaProxy_ = nullptr; -} - bool DynamicCache::InvalidateCache() { HILOGD("DynamicCache InvalidateCache Begin"); -- Gitee From b2c9718cb9ebcae2ac7bbbe0ab49435f8d85835d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Tue, 18 Mar 2025 21:09:41 +0800 Subject: [PATCH 11/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp index 805d5477..e0deff3b 100644 --- a/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp +++ b/interfaces/innerkits/dynamic_cache/src/dynamic_cache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 -- Gitee From 0da09bfcc8e006f639904ae8e40abede0baa5e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Thu, 20 Mar 2025 09:45:10 +0800 Subject: [PATCH 12/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/include/dynamic_cache.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h index f4ad6f17..1e0513b6 100644 --- a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h +++ b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h @@ -29,7 +29,6 @@ public: void OnRemoteDied(const wptr& remote) override { - HILOGD("DynamicCache OnRemoteDied called"); ClearCache(); } @@ -40,7 +39,6 @@ public: { std::lock_guard autoLock(queryCacheLock_); if (lastQuerySaProxy_ != nullptr) { - HILOGD("DynamicCache RemoveDeathRecipient"); lastQuerySaProxy_->RemoveDeathRecipient(this); } lastQuerySaId_ = -1; -- Gitee From 695bad8b75fdebbe47330e96ff849a5e54806456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Thu, 20 Mar 2025 09:47:06 +0800 Subject: [PATCH 13/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/include/dynamic_cache.h | 1 - 1 file changed, 1 deletion(-) diff --git a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h index 1e0513b6..7f420547 100644 --- a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h +++ b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h @@ -20,7 +20,6 @@ #include #include "datetime_ex.h" #include "iremote_object.h" -#include "sam_log.h" namespace OHOS { using namespace std; -- Gitee From 6de7a87dc0feb430d14818c4b1f2fcb5304b0338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Thu, 20 Mar 2025 10:26:31 +0800 Subject: [PATCH 14/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/include/dynamic_cache.h | 1 - 1 file changed, 1 deletion(-) diff --git a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h index 7f420547..55a00f31 100644 --- a/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h +++ b/interfaces/innerkits/dynamic_cache/include/dynamic_cache.h @@ -18,7 +18,6 @@ #include #include -#include "datetime_ex.h" #include "iremote_object.h" namespace OHOS { -- Gitee From 9eef07547339b62367a53568f007e9bd4af75907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Sat, 22 Mar 2025 14:32:39 +0800 Subject: [PATCH 15/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- interfaces/innerkits/dynamic_cache/BUILD.gn | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/interfaces/innerkits/dynamic_cache/BUILD.gn b/interfaces/innerkits/dynamic_cache/BUILD.gn index dce41a63..4c5fc7d3 100644 --- a/interfaces/innerkits/dynamic_cache/BUILD.gn +++ b/interfaces/innerkits/dynamic_cache/BUILD.gn @@ -20,7 +20,7 @@ config("dynamic_cache_config") { include_dirs = [ "include" ] } -ohos_shared_library("dynamic_cache") { +ohos_static_library("dynamic_cache") { sanitize = { cfi = true cfi_cross_dso = true @@ -41,9 +41,6 @@ ohos_shared_library("dynamic_cache") { "ipc:ipc_core", ] } - innerapi_tags = [ "chipsetsdk_indirect" ] - install_images = [ system_base_dir ] - relative_install_dir = "chipset-pub-sdk" part_name = "samgr" subsystem_name = "systemabilitymgr" } -- Gitee From 24f33bf5ebb5e7aaf3bb73fe810da29ab4a2ca89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=98=89=E5=AE=9D?= Date: Tue, 25 Mar 2025 21:38:51 +0800 Subject: [PATCH 16/25] commit msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄嘉宝 --- services/samgr/native/test/unittest/BUILD.gn | 77 ++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/services/samgr/native/test/unittest/BUILD.gn b/services/samgr/native/test/unittest/BUILD.gn index 1093230a..d213f676 100644 --- a/services/samgr/native/test/unittest/BUILD.gn +++ b/services/samgr/native/test/unittest/BUILD.gn @@ -156,6 +156,13 @@ ohos_unittest("SystemAbilityMgrTest") { } ohos_unittest("SystemAbilityMgrCollectTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } module_out_path = module_output_path sources = [ @@ -282,6 +289,13 @@ ohos_unittest("SystemAbilityMgrCollectTest") { } ohos_unittest("SystemAbilityMgrDeviceNetworkingTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } module_out_path = module_output_path sources = [ @@ -375,6 +389,13 @@ ohos_unittest("SystemAbilityMgrDeviceNetworkingTest") { } ohos_unittest("SystemAbilityMgrStubTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } module_out_path = module_output_path sources = [ @@ -466,6 +487,13 @@ ohos_unittest("SystemAbilityMgrStubTest") { } ohos_unittest("SystemAbilityMgrProxyTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } module_out_path = module_output_path sources = [ @@ -554,6 +582,13 @@ ohos_unittest("LocalAbilityManagerProxyTest") { } ohos_unittest("SystemAbilityStateSchedulerTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } module_out_path = module_output_path sources = [ @@ -635,6 +670,13 @@ ohos_unittest("SystemAbilityStateSchedulerTest") { } ohos_unittest("SystemAbilityMgrDumperTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } module_out_path = module_output_path sources = [ @@ -699,6 +741,13 @@ ohos_unittest("SystemAbilityMgrDumperTest") { } ohos_unittest("MockSystemAbilityManagerTest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } module_out_path = module_output_path sources = [ @@ -745,6 +794,13 @@ ohos_unittest("MockSystemAbilityManagerTest") { } ohos_executable("manual_ondemand") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } testonly = true sources = [ "${samgr_services_dir}/test/unittest/src/mock_permission.cpp", @@ -786,6 +842,13 @@ ohos_executable("manual_ondemand") { } ohos_executable("ondemand") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } testonly = true sources = [ "${samgr_services_dir}/test/unittest/src/mock_permission.cpp", @@ -827,6 +890,13 @@ ohos_executable("ondemand") { } ohos_executable("TestTool") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } testonly = true #module_out_path = module_output_path @@ -923,6 +993,13 @@ ohos_executable("TestTool") { } ohos_static_library("samgr_proxy_tdd") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + cfi_no_nvcall = true + blocklist = "../../../../../cfi_blocklist.txt" + } defines = [ "SAMGR_PROXY" ] sources = [ "//foundation/systemabilitymgr/samgr/frameworks/native/source/system_ability_load_callback_stub.cpp", -- Gitee From a3a9541379f27e6be28da81b48cb166871da9332 Mon Sep 17 00:00:00 2001 From: wuminjie Date: Fri, 28 Mar 2025 11:40:53 +0800 Subject: [PATCH 17/25] =?UTF-8?q?=E5=8E=BB=E9=99=A4public?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuminjie --- interfaces/innerkits/common/BUILD.gn | 2 +- services/samgr/native/BUILD.gn | 1 + test/fuzztest/samgr_fuzzer/BUILD.gn | 1 + test/fuzztest/samgrcoverage_fuzzer/BUILD.gn | 1 + test/fuzztest/samgrdumper_fuzzer/BUILD.gn | 1 + test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/interfaces/innerkits/common/BUILD.gn b/interfaces/innerkits/common/BUILD.gn index 837fb697..639f675d 100644 --- a/interfaces/innerkits/common/BUILD.gn +++ b/interfaces/innerkits/common/BUILD.gn @@ -79,7 +79,7 @@ ohos_shared_library("samgr_common") { external_deps += [ "hicollie:libhicollie" ] defines += [ "HICOLLIE_ENABLE" ] } - public_external_deps = [ "json:nlohmann_json_static" ] + external_deps += [ "json:nlohmann_json_static" ] part_name = "samgr" } diff --git a/services/samgr/native/BUILD.gn b/services/samgr/native/BUILD.gn index e9acf73f..34cccf36 100644 --- a/services/samgr/native/BUILD.gn +++ b/services/samgr/native/BUILD.gn @@ -105,6 +105,7 @@ ohos_executable("samgr") { "init:libbegetutil", "ipc:ipc_core", "ipc:libdbinder", + "json:nlohmann_json_static", "safwk:system_ability_ondemand_reason", ] diff --git a/test/fuzztest/samgr_fuzzer/BUILD.gn b/test/fuzztest/samgr_fuzzer/BUILD.gn index 26566694..62412f66 100644 --- a/test/fuzztest/samgr_fuzzer/BUILD.gn +++ b/test/fuzztest/samgr_fuzzer/BUILD.gn @@ -181,6 +181,7 @@ foreach(item, samgr_fuzztests) { "init:libbegetutil", "ipc:ipc_core", "ipc:libdbinder", + "json:nlohmann_json_static", "safwk:system_ability_fwk", "samgr:samgr_common", "samgr:samgr_proxy", diff --git a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn index db80705a..328c79b6 100644 --- a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn @@ -84,6 +84,7 @@ ohos_fuzztest("SamgrCoverageFuzzTest") { "init:libbegetutil", "ipc:ipc_single", "ipc:libdbinder", + "json:nlohmann_json_static", "safwk:system_ability_fwk", "samgr:samgr_common", "samgr:samgr_proxy", diff --git a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn index 1d6123d8..d644470c 100644 --- a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn @@ -83,6 +83,7 @@ ohos_fuzztest("SamgrDumperFuzzTest") { "init:libbegetutil", "ipc:ipc_single", "ipc:libdbinder", + "json:nlohmann_json_static", "safwk:system_ability_fwk", "samgr:samgr_common", "samgr:samgr_proxy", diff --git a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn index c5357e93..bd0e4c07 100644 --- a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn +++ b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn @@ -83,6 +83,7 @@ ohos_fuzztest("SystemAbilityManagerFuzzTest") { "init:libbegetutil", "ipc:ipc_core", "ipc:libdbinder", + "json:nlohmann_json_static", "safwk:system_ability_fwk", "samgr:samgr_common", "samgr:samgr_proxy", -- Gitee From b858d3a0d2484c8c140630ab0e98a44d65ae7a8d Mon Sep 17 00:00:00 2001 From: gongguilin Date: Fri, 28 Mar 2025 15:32:59 +0800 Subject: [PATCH 18/25] Delay SA_IDLE interval time Signed-off-by: gongguilin --- services/samgr/native/source/collect/ref_count_collect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/samgr/native/source/collect/ref_count_collect.cpp b/services/samgr/native/source/collect/ref_count_collect.cpp index 66b62b1c..bafb0e61 100644 --- a/services/samgr/native/source/collect/ref_count_collect.cpp +++ b/services/samgr/native/source/collect/ref_count_collect.cpp @@ -17,7 +17,7 @@ namespace OHOS { namespace { -constexpr int32_t REF_RESIDENT_TIMER_INTERVAL = 1000 * 60 * 10; +constexpr int32_t REF_RESIDENT_TIMER_INTERVAL = 1000 * 60 * 60; constexpr int32_t REF_ONDEMAND_TIMER_INTERVAL = 1000 * 60 * 1; } -- Gitee From 6530a2f0094b4773e5dc3be1152d5c5a0d6eda84 Mon Sep 17 00:00:00 2001 From: gongguilin Date: Sat, 29 Mar 2025 19:42:50 +0800 Subject: [PATCH 19/25] =?UTF-8?q?fuzz=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gongguilin --- .../samgrdumper_fuzzer/samgrdumper_fuzzer.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/fuzztest/samgrdumper_fuzzer/samgrdumper_fuzzer.cpp b/test/fuzztest/samgrdumper_fuzzer/samgrdumper_fuzzer.cpp index c81daef5..aa01728b 100644 --- a/test/fuzztest/samgrdumper_fuzzer/samgrdumper_fuzzer.cpp +++ b/test/fuzztest/samgrdumper_fuzzer/samgrdumper_fuzzer.cpp @@ -67,6 +67,13 @@ std::string BuildStringFromData(const uint8_t* data, size_t size) return strVal; } +void InitData(const uint8_t* data, size_t size) +{ + g_baseFuzzData = data; + g_baseFuzzSize = size; + g_baseFuzzPos = 0; +} + void SamgrDumperFuzzTest(const uint8_t* data, size_t size) { SamMockPermission::MockProcess(HIDUMPER_PROCESS_NAME); @@ -103,12 +110,9 @@ void SamgrDumperFuzzTest(const uint8_t* data, size_t size) manager->IpcDumpSingleProcess(fd, cmd, processName); } -void FuzzListenerDumpProc(const uint8_t* data, size_t size) +void FuzzListenerDumpProc() { SamMockPermission::MockProcess(HIDUMPER_PROCESS_NAME); - g_baseFuzzData = data; - g_baseFuzzSize = size; - g_baseFuzzPos = 0; int32_t pid1 = GetData(); int32_t pid2 = GetData(); std::map> dumpListeners; @@ -149,11 +153,8 @@ void FuzzListenerDumpProc(const uint8_t* data, size_t size) args.clear(); } -void FuzzFfrtLoadMetrics(const uint8_t* data, size_t size) +void FuzzFfrtLoadMetrics() { - g_baseFuzzData = data; - g_baseFuzzSize = size; - g_baseFuzzPos = 0; int32_t pid = GetData(); std::shared_ptr scheduler = std::make_shared(); int32_t fd = -1; @@ -182,9 +183,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) return 0; } + OHOS::Samgr::InitData(data, size); OHOS::Samgr::SamgrDumperFuzzTest(data, size); - OHOS::Samgr::FuzzListenerDumpProc(data, size); - OHOS::Samgr::FuzzFfrtLoadMetrics(data, size); + OHOS::Samgr::FuzzListenerDumpProc(); + OHOS::Samgr::FuzzFfrtLoadMetrics(); return 0; } -- Gitee From 791c96a593167eaa54456a9275572167479f414d Mon Sep 17 00:00:00 2001 From: wuminjie Date: Fri, 28 Mar 2025 16:32:45 +0800 Subject: [PATCH 20/25] =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuminjie --- services/samgr/native/test/unittest/BUILD.gn | 3 +++ test/fuzztest/samgr_fuzzer/BUILD.gn | 1 + test/fuzztest/samgrcoverage_fuzzer/BUILD.gn | 1 + test/fuzztest/samgrdumper_fuzzer/BUILD.gn | 1 + test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn | 1 + 5 files changed, 7 insertions(+) diff --git a/services/samgr/native/test/unittest/BUILD.gn b/services/samgr/native/test/unittest/BUILD.gn index 3b0a2f5c..94c96b0c 100644 --- a/services/samgr/native/test/unittest/BUILD.gn +++ b/services/samgr/native/test/unittest/BUILD.gn @@ -731,6 +731,7 @@ ohos_unittest("SystemAbilityMgrDumperTest") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", + "samgr:dynamic_cache", ] defines = [] if (samgr_support_access_token) { @@ -784,6 +785,7 @@ ohos_unittest("MockSystemAbilityManagerTest") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", + "samgr:dynamic_cache", ] defines = [] if (samgr_support_access_token) { @@ -989,6 +991,7 @@ ohos_executable("TestTool") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", + "samgr:dynamic_cache", ] part_name = "samgr" subsystem_name = "systemabilitymgr" diff --git a/test/fuzztest/samgr_fuzzer/BUILD.gn b/test/fuzztest/samgr_fuzzer/BUILD.gn index 62412f66..b86f6e95 100644 --- a/test/fuzztest/samgr_fuzzer/BUILD.gn +++ b/test/fuzztest/samgr_fuzzer/BUILD.gn @@ -183,6 +183,7 @@ foreach(item, samgr_fuzztests) { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", + "samgr:dynamic_cache", "samgr:samgr_common", "samgr:samgr_proxy", ] diff --git a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn index 328c79b6..39065272 100644 --- a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn @@ -86,6 +86,7 @@ ohos_fuzztest("SamgrCoverageFuzzTest") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", + "samgr:dynamic_cache", "samgr:samgr_common", "samgr:samgr_proxy", ] diff --git a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn index d644470c..7d446182 100644 --- a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn @@ -85,6 +85,7 @@ ohos_fuzztest("SamgrDumperFuzzTest") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", + "samgr:dynamic_cache", "samgr:samgr_common", "samgr:samgr_proxy", ] diff --git a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn index bd0e4c07..9e0cf86a 100644 --- a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn +++ b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn @@ -85,6 +85,7 @@ ohos_fuzztest("SystemAbilityManagerFuzzTest") { "ipc:libdbinder", "json:nlohmann_json_static", "safwk:system_ability_fwk", + "samgr:dynamic_cache", "samgr:samgr_common", "samgr:samgr_proxy", ] -- Gitee From 54fb718dce5dd67c049630ad61b2741d0c64fec6 Mon Sep 17 00:00:00 2001 From: shaojiequ Date: Wed, 2 Apr 2025 17:45:59 +0800 Subject: [PATCH 21/25] add proc to perf_sensitive Signed-off-by: shaojiequ --- etc/samgr_standard.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/samgr_standard.cfg b/etc/samgr_standard.cfg index a3ce2cd8..3b7f03bf 100644 --- a/etc/samgr_standard.cfg +++ b/etc/samgr_standard.cfg @@ -12,6 +12,7 @@ "critical" : [1, 1, 60], "uid" : "samgr", "gid" : ["samgr", "system", "readproc", "data_reserve"], + "writepid" : ["/dev/memcg/perf_sensitive/cgroup.procs"], "file" : ["/dev/kmsg rd 0660 root system"], "bootevents":"bootevent.samgr.ready", "permission": [ -- Gitee From 376cbdf1164c1cf0af1437980b9fc22c6034b815 Mon Sep 17 00:00:00 2001 From: lizhifeng Date: Thu, 3 Apr 2025 14:41:50 +0800 Subject: [PATCH 22/25] add nfc_tag sa id Signed-off-by: lizhifeng --- interfaces/innerkits/rust/src/definition.rs | 1 + .../innerkits/samgr_proxy/include/system_ability_definition.h | 1 + 2 files changed, 2 insertions(+) diff --git a/interfaces/innerkits/rust/src/definition.rs b/interfaces/innerkits/rust/src/definition.rs index fd1bd0e2..b1157cee 100644 --- a/interfaces/innerkits/rust/src/definition.rs +++ b/interfaces/innerkits/rust/src/definition.rs @@ -82,6 +82,7 @@ pub const WIFI_SCAN_SYS_ABILITY_ID: i32 = 1124; pub const BLUETOOTH_HOST_SYS_ABILITY_ID: i32 = 1130; pub const NFC_MANAGER_SYS_ABILITY_ID: i32 = 1140; pub const SE_MANAGER_SYS_ABILITY_ID: i32 = 1141; +pub const NFC_TAG_SYS_ABILITY_ID: i32 = 1148; pub const DISCOVER_SYS_ABILITY_ID: i32 = 1160; pub const DNET_SYS_ABILITY_ID: i32 = 1170; pub const NET_MANAGER_SYS_ABILITY_ID: i32 = 1150; diff --git a/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h b/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h index 354fb74a..c8ead207 100644 --- a/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h +++ b/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h @@ -88,6 +88,7 @@ enum { BLUETOOTH_HOST_SYS_ABILITY_ID = 1130, NFC_MANAGER_SYS_ABILITY_ID = 1140, SE_MANAGER_SYS_ABILITY_ID = 1141, + NFC_TAG_SYS_ABILITY_ID = 1148, DISCOVER_SYS_ABILITY_ID = 1160, DNET_SYS_ABILITY_ID = 1170, NET_MANAGER_SYS_ABILITY_ID = 1150, -- Gitee From b428da8018da5f1eb65a5ee5798ebbcfa26d6831 Mon Sep 17 00:00:00 2001 From: wuminjie Date: Thu, 17 Apr 2025 10:08:56 +0800 Subject: [PATCH 23/25] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuminjie --- services/samgr/native/source/system_ability_manager_dumper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/samgr/native/source/system_ability_manager_dumper.cpp b/services/samgr/native/source/system_ability_manager_dumper.cpp index 7ee5db86..aee4cd34 100644 --- a/services/samgr/native/source/system_ability_manager_dumper.cpp +++ b/services/samgr/native/source/system_ability_manager_dumper.cpp @@ -403,7 +403,7 @@ void SystemAbilityManagerDumper::FfrtStatisticsParser(std::string& result) uint64_t minTime = std::numeric_limits::max(); uint64_t sumTime = 0; uint64_t avgTime = 0; - int count = 0; + uint64_t count = 0; while ((char*)currentStat < lastStat && std::strcmp(currentStat->taskName, "") != 0) { if (currentStat->startTime > currentStat->endTime) { currentStat = (ffrt_stat*)((char*)currentStat + FFRT_STAT_SIZE); -- Gitee From e5528abef4e26123cbd6a48e1118d8c15c9ad327 Mon Sep 17 00:00:00 2001 From: zhang-deyao Date: Sat, 19 Apr 2025 08:54:55 +0000 Subject: [PATCH 24/25] update interfaces/innerkits/samgr_proxy/include/system_ability_definition.h. Signed-off-by: zhang-deyao --- .../innerkits/samgr_proxy/include/system_ability_definition.h | 1 + 1 file changed, 1 insertion(+) diff --git a/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h b/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h index c8ead207..25906744 100644 --- a/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h +++ b/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h @@ -321,6 +321,7 @@ enum { ARKUI_UI_APPEARANCE_SERVICE_ID = 7002, CA_DAEMON_ID = 8001, TRUSTED_SERVICE_ID = 8002, + ANTI_FRAUD_SERVICE_ID = 8003, ASSET_SERVICE_ID = 8100, EL5_FILEKEY_MANAGER_SERVICE_ID = 8250, COMM_FIREWALL_MANAGER_SYS_ABILITY_ID = 8300, -- Gitee From c7750feadd20b11ef861835e3e678d72328d90e0 Mon Sep 17 00:00:00 2001 From: zhang-deyao Date: Sat, 19 Apr 2025 08:55:54 +0000 Subject: [PATCH 25/25] update interfaces/innerkits/rust/src/definition.rs. Signed-off-by: zhang-deyao --- interfaces/innerkits/rust/src/definition.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interfaces/innerkits/rust/src/definition.rs b/interfaces/innerkits/rust/src/definition.rs index b1157cee..a766ac3b 100644 --- a/interfaces/innerkits/rust/src/definition.rs +++ b/interfaces/innerkits/rust/src/definition.rs @@ -307,6 +307,8 @@ pub const ECOLOGICAL_RULE_MANAGER_SA_ID: i32 = 6105; pub const SUBSYS_ACE_SYS_ABILITY_ID_BEGIN: i32 = 7001; pub const ARKUI_UI_APPEARANCE_SERVICE_ID: i32 = 7002; pub const CA_DAEMON_ID: i32 = 8001; +pub const TRUSTED_SERVICE_ID: i32 = 8002; +pub const ANTI_FRAUD_SERVICE_ID: i32 = 8003; pub const COMM_WEARABLE_DISTRIBUTED_NET_ABILITY_ID: i32 = 8400; // reserved for vendor -- Gitee