From 092e688085a106e0ecf6cbc5a0616e231afff71d Mon Sep 17 00:00:00 2001 From: wanxiaoqing Date: Tue, 24 Jun 2025 14:09:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EappID=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanxiaoqing --- .../service/test/BUILD.gn | 2 + .../test/udmf_preprocess_utils_test.cpp | 14 + .../service/test/udmf_service_impl_test.cpp | 305 ++++++++++++++++-- .../service/udmf/BUILD.gn | 1 + .../udmf/preprocess/preprocess_utils.cpp | 31 ++ .../udmf/preprocess/preprocess_utils.h | 1 + .../service/udmf/udmf_service_impl.cpp | 66 +++- .../service/udmf/udmf_service_impl.h | 3 + 8 files changed, 388 insertions(+), 35 deletions(-) diff --git a/services/distributeddataservice/service/test/BUILD.gn b/services/distributeddataservice/service/test/BUILD.gn index 7c20c4aa2..46425ddb4 100644 --- a/services/distributeddataservice/service/test/BUILD.gn +++ b/services/distributeddataservice/service/test/BUILD.gn @@ -1562,6 +1562,8 @@ ohos_unittest("UdmfPreProcessUtilsTest") { external_deps = [ "ability_runtime:uri_permission_mgr", "access_token:libaccesstoken_sdk", + "access_token:libnativetoken", + "access_token:libtoken_setproc", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", diff --git a/services/distributeddataservice/service/test/udmf_preprocess_utils_test.cpp b/services/distributeddataservice/service/test/udmf_preprocess_utils_test.cpp index 8ffe52b9e..c42f223a7 100644 --- a/services/distributeddataservice/service/test/udmf_preprocess_utils_test.cpp +++ b/services/distributeddataservice/service/test/udmf_preprocess_utils_test.cpp @@ -179,4 +179,18 @@ HWTEST_F(UdmfPreProcessUtilsTest, GetHtmlFileUris001, TestSize.Level1) PreProcessUtils preProcessUtils; EXPECT_NO_FATAL_FAILURE(preProcessUtils.GetHtmlFileUris(tokenId, data, isLocal, uris)); } + +/** +* @tc.name: GetAppId001 +* @tc.desc: Abnormal test of GetAppId, samgrProxy is nullptr +* @tc.type: FUNC +* @tc.require: +*/ +HWTEST_F(UdmfPreProcessUtilsTest, GetAppId001, TestSize.Level1) +{ + std::string bundleName = "test"; + PreProcessUtils preProcessUtils; + std::string appId = preProcessUtils.GetAppId(bundleName); + EXPECT_EQ(appId, ""); +} }; // namespace UDMF \ No newline at end of file diff --git a/services/distributeddataservice/service/test/udmf_service_impl_test.cpp b/services/distributeddataservice/service/test/udmf_service_impl_test.cpp index bcb18a864..4f3a53841 100644 --- a/services/distributeddataservice/service/test/udmf_service_impl_test.cpp +++ b/services/distributeddataservice/service/test/udmf_service_impl_test.cpp @@ -27,6 +27,8 @@ #include "preprocess_utils.h" #include "runtime_store.h" #include "text.h" +#include "plain_text.h" +#include "udmf_client.h" #include "token_setproc.h" using namespace testing::ext; @@ -42,7 +44,110 @@ using Summary = OHOS::UDMF::Summary; namespace OHOS::Test { namespace DistributedDataTest { -static void GrantPermissionNative() + +class UdmfServiceImplTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp() override; + void TearDown() override; + + static void AllocHapToken1(); + static void SetHapToken1(); + + void AddPrivilege(QueryOption &option); + static void GrantPermissionNative(); + + static constexpr int userId = 100; + static constexpr int instIndex = 0; + const std::string STORE_ID = "drag"; +}; + +void UdmfServiceImplTest::SetUpTestCase() +{ + AllocHapToken1(); + GrantPermissionNative(); + DistributedData::Bootstrap::GetInstance().LoadComponents(); + DistributedData::Bootstrap::GetInstance().LoadDirectory(); + DistributedData::Bootstrap::GetInstance().LoadCheckers(); + size_t max = 2; + size_t min = 1; + auto executors = std::make_shared(max, min); + DmAdapter::GetInstance().Init(executors); + DistributedKv::KvStoreMetaManager::GetInstance().BindExecutor(executors); + DistributedKv::KvStoreMetaManager::GetInstance().InitMetaParameter(); + DistributedKv::KvStoreMetaManager::GetInstance().InitMetaListener(); +} + +void UdmfServiceImplTest::TearDownTestCase() +{ + auto tokenId = AccessTokenKit::GetHapTokenID(userId, "ohos.file.manger.test.demo1", instIndex); + AccessTokenKit::DeleteToken(tokenId); + tokenId = AccessTokenKit::GetHapTokenID(userId, "ohos.file.manger.test.demo2", instIndex); + AccessTokenKit::DeleteToken(tokenId); +} + +void UdmfServiceImplTest::SetUp() +{ + SetHapToken1(); +} + +void UdmfServiceImplTest::TearDown() +{ + QueryOption query = { .intention = Intention::UD_INTENTION_PICKER }; + std::vector unifiedDataSet; + UdmfClient::GetInstance().DeleteData(query, unifiedDataSet); + query = { .intention = Intention::UD_INTENTION_MENU }; + UdmfClient::GetInstance().DeleteData(query, unifiedDataSet); + query = { .intention = Intention::UD_INTENTION_SYSTEM_SHARE }; + UdmfClient::GetInstance().DeleteData(query, unifiedDataSet); +} + +void UdmfServiceImplTest::AllocHapToken1() +{ + HapInfoParams info = { + .userID = userId, + .bundleName = "ohos.file.manger.test.demo1", + .instIndex = instIndex, + .appIDDesc = "ohos.file.manger.test.demo1" + }; + + HapPolicyParams policy = { + .apl = APL_NORMAL, + .domain = "test.domain", + .permList = { + { + .permissionName = "ohos.permission.test", + .bundleName = "ohos.file.manger.test.demo1", + .grantMode = 1, + .availableLevel = APL_NORMAL, + .label = "label", + .labelId = 1, + .description = "test1", + .descriptionId = 1 + } + }, + .permStateList = { + { + .permissionName = "ohos.permission.test", + .isGeneral = true, + .resDeviceID = { "local" }, + .grantStatus = { PermissionState::PERMISSION_GRANTED }, + .grantFlags = { 1 } + } + } + }; + auto tokenID = AccessTokenKit::AllocHapToken(info, policy); + SetSelfTokenID(tokenID.tokenIDEx); +} + +void UdmfServiceImplTest::SetHapToken1() +{ + auto tokenId = AccessTokenKit::GetHapTokenID(userId, "ohos.file.manger.test.demo1", instIndex); + SetSelfTokenID(tokenId); +} + +void UdmfServiceImplTest::GrantPermissionNative() { const char **perms = new const char *[3]; perms[0] = "ohos.permission.DISTRIBUTED_DATASYNC"; @@ -64,29 +169,6 @@ static void GrantPermissionNative() delete[] perms; } -class UdmfServiceImplTest : public testing::Test { -public: - static void SetUpTestCase(void) - { - GrantPermissionNative(); - DistributedData::Bootstrap::GetInstance().LoadComponents(); - DistributedData::Bootstrap::GetInstance().LoadDirectory(); - DistributedData::Bootstrap::GetInstance().LoadCheckers(); - size_t max = 2; - size_t min = 1; - auto executors = std::make_shared(max, min); - DmAdapter::GetInstance().Init(executors); - DistributedKv::KvStoreMetaManager::GetInstance().BindExecutor(executors); - DistributedKv::KvStoreMetaManager::GetInstance().InitMetaParameter(); - DistributedKv::KvStoreMetaManager::GetInstance().InitMetaListener(); - } - static void TearDownTestCase(void){}; - void SetUp(){}; - void TearDown(){}; - - const std::string STORE_ID = "drag"; -}; - /** * @tc.name: SaveData001 * @tc.desc: Abnormal test of SaveData, unifiedData is invalid @@ -431,5 +513,180 @@ HWTEST_F(UdmfServiceImplTest, IsValidInput004, TestSize.Level1) bool result = impl.IsValidInput(query, unifiedData, key); EXPECT_FALSE(result); } + +/** + * @tc.name: CheckAppId001 + * @tc.desc: invalid bundleName + * @tc.type: FUNC + */ +HWTEST_F(UdmfServiceImplTest, CheckAppId001, TestSize.Level1) +{ + std::shared_ptr runtime = std::make_shared(); + runtime->appId = "appId"; + std::string bundleName = "ohos.test.demo1"; + + UdmfServiceImpl impl; + int32_t result = impl.CheckAppId(runtime, bundleName); + EXPECT_EQ(result, E_INVALID_PARAMETERS); +} + +/** + * @tc.name: CheckAppId002 + * @tc.desc: invalid runtime + * @tc.type: FUNC + */ +HWTEST_F(UdmfServiceImplTest, CheckAppId002, TestSize.Level1) +{ + std::shared_ptr runtime = std::make_shared(); + std::string bundleName = "ohos.test.demo1"; + + UdmfServiceImpl impl; + int32_t result = impl.CheckAppId(runtime, bundleName); + EXPECT_EQ(result, E_INVALID_PARAMETERS); +} + +/** + * @tc.name: ValidateAndProcessRuntimeData001 + * @tc.desc: invalid intention + * @tc.type: FUNC + */ +HWTEST_F(UdmfServiceImplTest, ValidateAndProcessRuntimeData001, TestSize.Level1) +{ + CustomOption customOption = { .intention = Intention::UD_INTENTION_DATA_HUB }; + UnifiedData data; + std::shared_ptr record = std::make_shared(UDType::PLAIN_TEXT, "plainTextContent"); + data.AddRecord(record); + std::shared_ptr<UnifiedDataProperties> properties = std::make_shared<UnifiedDataProperties>(); + std::string tag = "this is a tag of test UpdateData001"; + properties->tag = tag; + data.SetProperties(std::move(properties)); + std::string key; + auto status = UdmfClient::GetInstance().SetData(customOption, data, key); + ASSERT_EQ(status, UDMF::E_OK); + + std::vector<UnifiedData> dataSet = {data}; + std::shared_ptr<Runtime> runtime; + std::vector<UnifiedData> unifiedDataSet; + std::vector<std::string> deleteKeys; + QueryOption query; + + UdmfServiceImpl impl; + int32_t result = impl.ValidateAndProcessRuntimeData(dataSet, runtime, unifiedDataSet, deleteKeys, query); + EXPECT_EQ(result, UDMF::E_DB_ERROR); +} + +/** + * @tc.name: ValidateAndProcessRuntimeData002 + * @tc.desc: invalid intention + * @tc.type: FUNC + */ +HWTEST_F(UdmfServiceImplTest, ValidateAndProcessRuntimeData002, TestSize.Level1) +{ + CustomOption customOption = { .intention = Intention::UD_INTENTION_DATA_HUB }; + UnifiedData data; + data.runtime_ = std::make_shared<Runtime>(); + data.runtime_->tokenId = 1; + std::shared_ptr<UnifiedRecord> record = std::make_shared<PlainText>(UDType::PLAIN_TEXT, "plainTextContent"); + data.AddRecord(record); + std::shared_ptr<UnifiedDataProperties> properties = std::make_shared<UnifiedDataProperties>(); + std::string tag = "this is a tag of test UpdateData001"; + properties->tag = tag; + data.SetProperties(std::move(properties)); + std::string key; + auto status = UdmfClient::GetInstance().SetData(customOption, data, key); + ASSERT_EQ(status, UDMF::E_OK); + + + std::vector<UnifiedData> dataSet = {data}; + std::shared_ptr<Runtime> runtime; + std::vector<UnifiedData> unifiedDataSet; + std::vector<std::string> deleteKeys; + QueryOption query; + query.tokenId = 1; + + UdmfServiceImpl impl; + int32_t result = impl.ValidateAndProcessRuntimeData(dataSet, runtime, unifiedDataSet, deleteKeys, query); + EXPECT_EQ(result, UDMF::E_OK); +} + +/** + * @tc.name: ValidateAndProcessRuntimeData003 + * @tc.desc: invalid intention + * @tc.type: FUNC + */ +HWTEST_F(UdmfServiceImplTest, ValidateAndProcessRuntimeData003, TestSize.Level1) +{ + CustomOption customOption = { .intention = Intention::UD_INTENTION_DATA_HUB }; + UnifiedData data; + data.runtime_ = std::make_shared<Runtime>(); + data.runtime_->tokenId = 1; + data.runtime_ = std::make_shared<Runtime>(); + data.runtime_->appId = "appId"; + std::shared_ptr<UnifiedRecord> record = std::make_shared<PlainText>(UDType::PLAIN_TEXT, "plainTextContent"); + data.AddRecord(record); + std::shared_ptr<UnifiedDataProperties> properties = std::make_shared<UnifiedDataProperties>(); + std::string tag = "this is a tag of test UpdateData001"; + properties->tag = tag; + data.SetProperties(std::move(properties)); + std::string key; + auto status = UdmfClient::GetInstance().SetData(customOption, data, key); + ASSERT_EQ(status, UDMF::E_OK); + + std::vector<UnifiedData> dataSet = {data}; + std::shared_ptr<Runtime> runtime; + std::vector<UnifiedData> unifiedDataSet; + std::vector<std::string> deleteKeys; + QueryOption query; + query.tokenId = 2; + + UdmfServiceImpl impl; + int32_t result = impl.ValidateAndProcessRuntimeData(dataSet, runtime, unifiedDataSet, deleteKeys, query); + EXPECT_EQ(result, UDMF::E_OK); +} + +/** + * @tc.name: ValidateAndProcessRuntimeData004 + * @tc.desc: invalid intention + * @tc.type: FUNC + */ +HWTEST_F(UdmfServiceImplTest, ValidateAndProcessRuntimeData005, TestSize.Level1) +{ + CustomOption customOption = { .intention = Intention::UD_INTENTION_DATA_HUB }; + UnifiedData data1; + data1.runtime_ = std::make_shared<Runtime>(); + data1.runtime_->tokenId = 1; + data1.runtime_ = std::make_shared<Runtime>(); + data1.runtime_->appId = "appId"; + std::shared_ptr<UnifiedRecord> record = std::make_shared<PlainText>(UDType::PLAIN_TEXT, "plainTextContent"); + data1.AddRecord(record); + std::shared_ptr<UnifiedDataProperties> properties = std::make_shared<UnifiedDataProperties>(); + std::string tag = "this is a tag of test UpdateData001"; + properties->tag = tag; + data1.SetProperties(std::move(properties)); + std::string key; + auto status = UdmfClient::GetInstance().SetData(customOption, data1, key); + ASSERT_EQ(status, UDMF::E_OK); + + UnifiedData data2; + data2.runtime_ = std::make_shared<Runtime>(); + data2.runtime_->tokenId = 1; + data2.runtime_ = std::make_shared<Runtime>(); + data2.runtime_->appId = "appId"; + data2.AddRecord(record); + data2.SetProperties(std::move(properties)); + status = UdmfClient::GetInstance().SetData(customOption, data2, key); + ASSERT_EQ(status, UDMF::E_OK); + + std::vector<UnifiedData> dataSet = { data1, data2 }; + std::shared_ptr<Runtime> runtime; + std::vector<UnifiedData> unifiedDataSet; + std::vector<std::string> deleteKeys; + QueryOption query; + query.tokenId = 2; + + UdmfServiceImpl impl; + int32_t result = impl.ValidateAndProcessRuntimeData(dataSet, runtime, unifiedDataSet, deleteKeys, query); + EXPECT_EQ(result, UDMF::E_OK); +} }; // namespace DistributedDataTest }; // namespace OHOS::Test diff --git a/services/distributeddataservice/service/udmf/BUILD.gn b/services/distributeddataservice/service/udmf/BUILD.gn index f8a62d82c..c908469df 100644 --- a/services/distributeddataservice/service/udmf/BUILD.gn +++ b/services/distributeddataservice/service/udmf/BUILD.gn @@ -19,6 +19,7 @@ config("module_public_config") { include_dirs = [ "${data_service_path}/adapter/include/communicator", "${data_service_path}/service/matrix/include", + "${data_service_path}/service/permission/include", "${data_service_path}/service/udmf/lifecycle", "${data_service_path}/service/udmf/permission", "${data_service_path}/service/udmf/preprocess", diff --git a/services/distributeddataservice/service/udmf/preprocess/preprocess_utils.cpp b/services/distributeddataservice/service/udmf/preprocess/preprocess_utils.cpp index 828031589..732afb8fc 100644 --- a/services/distributeddataservice/service/udmf/preprocess/preprocess_utils.cpp +++ b/services/distributeddataservice/service/udmf/preprocess/preprocess_utils.cpp @@ -32,6 +32,8 @@ #include "udmf_utils.h" #include "utils/crypto.h" #include "uri_permission_manager_client.h" +#include "ipc_skeleton.h" +#include "bundle_mgr_interface.h" namespace OHOS { namespace UDMF { static constexpr int ID_LEN = 32; @@ -69,6 +71,7 @@ int32_t PreProcessUtils::FillRuntimeInfo(UnifiedData &data, CustomOption &option UnifiedKey key(intention, bundleName, GenerateId()); Privilege privilege; privilege.tokenId = option.tokenId; + std::string appId = GetAppId(bundleName); Runtime runtime; runtime.key = key; runtime.privileges.emplace_back(privilege); @@ -80,6 +83,7 @@ int32_t PreProcessUtils::FillRuntimeInfo(UnifiedData &data, CustomOption &option runtime.tokenId = option.tokenId; runtime.sdkVersion = GetSdkVersionByToken(option.tokenId); runtime.visibility = option.visibility; + runtime.appId = appId; data.SetRuntime(runtime); return E_OK; } @@ -147,6 +151,33 @@ bool PreProcessUtils::GetNativeProcessNameByToken(int tokenId, std::string &proc return true; } +std::string PreProcessUtils::GetAppId(const std::string &bundleName) +{ + auto samgrProxy = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgrProxy == nullptr) { + ZLOGE("Failed to get system ability mgr."); + return ""; + } + auto bundleMgrProxy = samgrProxy->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); + if (bundleMgrProxy == nullptr) { + ZLOGE("Failed to Get BMS SA."); + return ""; + } + auto bundleManager = iface_cast<AppExecFwk::IBundleMgr>(bundleMgrProxy); + if (bundleManager == nullptr) { + ZLOGE("Failed to get bundle manager"); + return ""; + } + int32_t uid = IPCSkeleton::GetCallingUid(); + int32_t userId = uid / OHOS::AppExecFwk::Constants::BASE_USER_RANGE; + std::string appId = bundleManager->GetAppIdByBundleName(bundleName, userId); + if (appId.empty()) { + ZLOGE("GetAppIdByBundleName failed appId:%{public}s, bundleName:%{public}s, uid:%{public}d", + appId.c_str(), bundleName.c_str(), userId); + } + return appId; +} + std::string PreProcessUtils::GetLocalDeviceId() { auto info = DistributedData::DeviceManagerAdapter::GetInstance().GetLocalDevice(); diff --git a/services/distributeddataservice/service/udmf/preprocess/preprocess_utils.h b/services/distributeddataservice/service/udmf/preprocess/preprocess_utils.h index 5d602b626..366dc17c6 100644 --- a/services/distributeddataservice/service/udmf/preprocess/preprocess_utils.h +++ b/services/distributeddataservice/service/udmf/preprocess/preprocess_utils.h @@ -44,6 +44,7 @@ public: static bool GetDetailsFromUData(const UnifiedData &data, UDDetails &details); static Status GetSummaryFromDetails(const UDDetails &details, Summary &summary); static bool GetSpecificBundleNameByTokenId(uint32_t tokenId, std::string &bundleName); + static std::string GetAppId(const std::string &bundleName); static sptr<AppExecFwk::IBundleMgr> GetBundleMgr(); private: static bool CheckUriAuthorization(const std::vector<std::string>& uris, uint32_t tokenId); diff --git a/services/distributeddataservice/service/udmf/udmf_service_impl.cpp b/services/distributeddataservice/service/udmf/udmf_service_impl.cpp index 1ceb45cc8..04e0cddd7 100644 --- a/services/distributeddataservice/service/udmf/udmf_service_impl.cpp +++ b/services/distributeddataservice/service/udmf/udmf_service_impl.cpp @@ -428,11 +428,15 @@ int32_t UdmfServiceImpl::UpdateData(const QueryOption &query, UnifiedData &unifi } std::shared_ptr<Runtime> runtime = data.GetRuntime(); if (runtime == nullptr) { + ZLOGW("Invalid parameter, intention: %{public}s.", key.intention.c_str()); return E_DB_ERROR; } + if (runtime->tokenId != query.tokenId && !HasDatahubPriviledge(bundleName)) { - ZLOGE("Update failed: tokenId mismatch"); - return E_INVALID_PARAMETERS; + if (CheckAppId(runtime, bundleName) != E_OK) { + ZLOGE("Update failed: tokenId mismatch"); + return E_INVALID_PARAMETERS; + } } runtime->lastModifiedTime = PreProcessUtils::GetTimestamp(); unifiedData.SetRuntime(*runtime); @@ -444,6 +448,20 @@ int32_t UdmfServiceImpl::UpdateData(const QueryOption &query, UnifiedData &unifi return E_OK; } +int32_t UdmfServiceImpl::CheckAppId(std::shared_ptr<Runtime> runtime, std::string bundleName) +{ + if (runtime->appId.empty()) { + ZLOGE("Update failed: tokenId mismatch"); + return E_INVALID_PARAMETERS; + } + std::string appId = PreProcessUtils::GetAppId(bundleName); + if (appId.empty() || appId != runtime->appId) { + ZLOGE("Update failed: tokenId mismatch"); + return E_INVALID_PARAMETERS; + } + return E_OK; +} + int32_t UdmfServiceImpl::DeleteData(const QueryOption &query, std::vector<UnifiedData> &unifiedDataSet) { ZLOGD("start"); @@ -470,15 +488,10 @@ int32_t UdmfServiceImpl::DeleteData(const QueryOption &query, std::vector<Unifie } std::shared_ptr<Runtime> runtime; std::vector<std::string> deleteKeys; - for (const auto &data : dataSet) { - runtime = data.GetRuntime(); - if (runtime == nullptr) { - return E_DB_ERROR; - } - if (runtime->tokenId == query.tokenId) { - unifiedDataSet.push_back(data); - deleteKeys.push_back(UnifiedKey(runtime->key.key).GetKeyCommonPrefix()); - } + status = ValidateAndProcessRuntimeData(dataSet, runtime, unifiedDataSet, deleteKeys, query); + if (status != E_OK) { + ZLOGE("ValidateAndProcessRuntimeData failed."); + return status; } if (deleteKeys.empty()) { ZLOGE("No data to delete for this application"); @@ -492,6 +505,37 @@ int32_t UdmfServiceImpl::DeleteData(const QueryOption &query, std::vector<Unifie return E_OK; } +int32_t UdmfServiceImpl::ValidateAndProcessRuntimeData(const std::vector<UnifiedData> &dataSet, + std::shared_ptr<Runtime> runtime, std::vector<UnifiedData> &unifiedDataSet, std::vector<std::string> &deleteKeys, + const QueryOption &query) +{ + std::string appId; + bool isFirstInvoke = false; + for (const auto &data : dataSet) { + runtime = data.GetRuntime(); + if (runtime == nullptr) { + return E_DB_ERROR; + } + if (runtime->tokenId != query.tokenId) { + if (runtime->appId.empty()) { + continue; + } + if (!isFirstInvoke) { + std::string bundleName; + PreProcessUtils::GetHapBundleNameByToken(query.tokenId, bundleName); + appId = PreProcessUtils::GetAppId(bundleName); + isFirstInvoke = true; + } + if (appId.empty() || appId != runtime->appId) { + continue; + } + } + unifiedDataSet.push_back(std::move(data)); + deleteKeys.emplace_back(UnifiedKey(runtime->key.key).GetKeyCommonPrefix()); + } + return E_OK; +} + int32_t UdmfServiceImpl::GetSummary(const QueryOption &query, Summary &summary) { ZLOGD("start"); diff --git a/services/distributeddataservice/service/udmf/udmf_service_impl.h b/services/distributeddataservice/service/udmf/udmf_service_impl.h index 8f366463f..8fd423280 100644 --- a/services/distributeddataservice/service/udmf/udmf_service_impl.h +++ b/services/distributeddataservice/service/udmf/udmf_service_impl.h @@ -80,6 +80,9 @@ private: std::string FindIntentionMap(const Intention &queryintention); bool IsValidOptionsNonDrag(UnifiedKey &key, const std::string &intention); bool IsValidInput(const QueryOption &query, UnifiedData &unifiedData, UnifiedKey &key); + int32_t ValidateAndProcessRuntimeData(const std::vector<UnifiedData> &dataSet, std::shared_ptr<Runtime> runtime, + std::vector<UnifiedData> &unifiedDataSet, std::vector<std::string> &deleteKeys, const QueryOption &query); + int32_t CheckAppId(std::shared_ptr<Runtime> runtime, std::string bundleName); class Factory { public: Factory(); -- Gitee