diff --git a/services/distributeddataservice/adapter/permission/src/permission_validator.cpp b/services/distributeddataservice/adapter/permission/src/permission_validator.cpp index 575f1b7f426d5c2e7ce41c260aef0dcad459624b..ed6f14b85f1e73d81aff4457949b902c56f796ed 100755 --- a/services/distributeddataservice/adapter/permission/src/permission_validator.cpp +++ b/services/distributeddataservice/adapter/permission/src/permission_validator.cpp @@ -33,9 +33,6 @@ std::set PermissionValidator::systemServiceList_ = { // initialize auto launch enabled applications white list. std::set PermissionValidator::autoLaunchEnableList_ = { - "providers.calendar", - "com.huawei.contacts.sync", - "com.huawei.ohos.totemweather" }; // check whether the client process have enough privilege to share data with the other devices. diff --git a/services/distributeddataservice/app/src/kvstore_meta_manager.cpp b/services/distributeddataservice/app/src/kvstore_meta_manager.cpp index 8bdc49d6e8fdfabda9d5360346c658771fc457cb..c403bd9b4cbb568a7bf8b34283b936f9067ef9a5 100755 --- a/services/distributeddataservice/app/src/kvstore_meta_manager.cpp +++ b/services/distributeddataservice/app/src/kvstore_meta_manager.cpp @@ -546,8 +546,7 @@ Status KvStoreMetaManager::RemoveSecretKey(const std::string &deviceAccountId, c status = Status::DB_ERROR; } - int securityLevel = SecurityLevel::NO_LABEL; - GetSecurityLevelByBundleName(bundleName, securityLevel); + int securityLevel = GetSecurityLevelByBundleName(bundleName); std::string secretKeyFile = GetSecretKeyFile(deviceAccountId, bundleName, storeId, securityLevel); bool rmFile = RemoveFile(secretKeyFile); if (!rmFile) { @@ -647,8 +646,7 @@ void KvStoreMetaManager::ReKey(const std::string &deviceAccountId, const std::st WriteSecretKeyToMeta(GetMetaKey(deviceAccountId, "default", bundleName, storeId, "KEY"), key); Status status = kvStoreimpl->ReKey(key); if (status == Status::SUCCESS) { - int securityLevel; - GetSecurityLevelByBundleName(bundleName, securityLevel); + int securityLevel = GetSecurityLevelByBundleName(bundleName); WriteSecretKeyToFile(GetSecretKeyFile(deviceAccountId, bundleName, storeId, securityLevel), key); } key.assign(key.size(), 0); @@ -666,8 +664,7 @@ void KvStoreMetaManager::ReKey(const std::string &deviceAccountId, const std::st WriteSecretKeyToMeta(GetMetaKey(deviceAccountId, "default", bundleName, storeId, "SINGLE_KEY"), key); Status status = kvStoreImpl->ReKey(key); if (status == Status::SUCCESS) { - int securityLevel = SecurityLevel::NO_LABEL; - GetSecurityLevelByBundleName(bundleName, securityLevel); + int securityLevel = GetSecurityLevelByBundleName(bundleName); WriteSecretKeyToFile(GetSecretSingleKeyFile(deviceAccountId, bundleName, storeId, securityLevel), key); } key.assign(key.size(), 0); @@ -1241,16 +1238,15 @@ bool KvStoreMetaManager::GetFullMetaData(std::map &entrie return true; } -bool KvStoreMetaManager::GetSecurityLevelByBundleName(const std::string &bundleName, int &securityLevel) +int KvStoreMetaManager::GetSecurityLevelByBundleName(const std::string &bundleName) { KvStoreMetaData kvStoreMetaData; auto getKvStoreMetaBMeta = GetKvStoreMetaByType(KvStoreMetaData::BUNDLE_NAME, bundleName, kvStoreMetaData); if (!getKvStoreMetaBMeta) { ZLOGE("getkvstore meta by type failed"); - return false; + return SecurityLevel::NO_LABEL; } - securityLevel = kvStoreMetaData.securityLevel; - return true; + return kvStoreMetaData.securityLevel; } bool KvStoreMetaManager::GetKvStoreMetaByType(const std::string &name, const std::string &val, diff --git a/services/distributeddataservice/app/src/kvstore_meta_manager.h b/services/distributeddataservice/app/src/kvstore_meta_manager.h index 0d05b68ee664ebb9c6f24724190696afca04108b..58bf8178a22793362ef171c73723c508fbe07f92 100755 --- a/services/distributeddataservice/app/src/kvstore_meta_manager.h +++ b/services/distributeddataservice/app/src/kvstore_meta_manager.h @@ -273,7 +273,7 @@ private: Status GetStategyMeta(const std::string &key, std::map> &strategies); - bool GetSecurityLevelByBundleName(const std::string &bundleName, int &securityLevel); + int GetSecurityLevelByBundleName(const std::string &bundleName); bool GetKvStoreMetaByType(const std::string &name, const std::string &val, KvStoreMetaData &metaData); diff --git a/services/distributeddataservice/test/moduletest/common/distributeddb/src/distributeddb_nb_batch_crud_test.cpp b/services/distributeddataservice/test/moduletest/common/distributeddb/src/distributeddb_nb_batch_crud_test.cpp index 0d1662649ef3668c74edbc935604ddb368d7de1e..a3c46b8564354742f3ba5e9bbe12050629831bcb 100755 --- a/services/distributeddataservice/test/moduletest/common/distributeddb/src/distributeddb_nb_batch_crud_test.cpp +++ b/services/distributeddataservice/test/moduletest/common/distributeddb/src/distributeddb_nb_batch_crud_test.cpp @@ -2429,7 +2429,7 @@ HWTEST_F(DistributeddbNbBatchCrudTest, TransactionObserver003, TestSize.Level1) } /** - * @tc.steps: step2. start the transaction and putBatch (k3, v3), (k4, v4), ..., (k8, v8) to db. + * @tc.steps: step2. start the transaction and putBatch (k3, v3), (k4, v4), ..., (k8, value8) to db. * @tc.expected: step2. start transaction and putBatch successfully. */ EXPECT_EQ(g_nbBatchCrudDelegate->StartTransaction(), OK); @@ -2448,7 +2448,7 @@ HWTEST_F(DistributeddbNbBatchCrudTest, TransactionObserver003, TestSize.Level1) /** * @tc.steps: step3. commit the transaction and check the observers. * @tc.expected: step3. commit succeed and all of the observers received one insert notify, callbacklist of which - * contains (k4, v4), ..., (k8, v8), all observer received one update notify, callbacklist of which contains + * contains (k4, v4), ..., (k8, value8), all observer received one update notify, callbacklist of which contains * (k2, v3), all observers received one insert notify, callback of which contains (k1, v1), (k3, v3), (k9, v9). */ EXPECT_EQ(g_nbBatchCrudDelegate->Commit(), OK);