内源检视问题修改, 增加OAT文件

Signed-off-by: zuojiangjiang <zuojiangjiang@huawei.com>
This commit is contained in:
zuojiangjiang 2022-03-21 22:13:17 +08:00
parent daffb1244a
commit d1cc827f23
159 changed files with 283 additions and 221 deletions

69
OAT.xml Normal file
View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 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.
-->
<!-- OAT(OSS Audit Tool) configuration guide:
basedir: Root dir, the basedir + project path is the real source file location.
licensefile:
1.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule.
tasklist(only for batch mode):
1. task: Define oat check thread, each task will start a new thread.
2. task name: Only an name, no practical effect.
3. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist.
4. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist.
5. task project: Projects to be checked, the path field define the source root dir of the project.
policyList:
1. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process.
2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
3. policyitem type:
"compatibility" is used to check license compatibility in the specified path;
"license" is used to check source license header in the specified path;
"copyright" is used to check source copyright header in the specified path;
"import" is used to check source dependency in the specified path, such as import ... ,include ...
"filetype" is used to check file type in the specified path, supported file types: archive, binary
"filename" is used to check whether the specified file exists in the specified path(support projectroot in default OAT.xml), supported file names: LICENSE, README, README.OpenSource
4. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license.
5. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem.
6. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed.
7. policyitem filefilter: Used to bind filefilter which define filter rules.
8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
Note:If the text contains special characters, please escape them according to the following rules:
" == &gt;
& == &gt;
' == &gt;
< == &gt;
> == &gt;
-->
<configuration>
<oatconfig>
<licensefile></licensefile>
<policylist>
<policy name="projectPolicy" desc="">
</policy>
</policylist>
<filefilterlist>
<filefilter name="defaultFilter" desc="Files not to check">
<filteritem type="filename" name="*.ha|*.hap|*.rpk" desc="valid and invalid bundle files for tests"/>
<filteritem type="filepath" name="figures/.*" desc="Self-developed image"/>
</filefilter>
</filefilterlist>
</oatconfig>
</configuration>

View File

@ -226,5 +226,5 @@ private:
mutable std::recursive_mutex mutex_;
std::map<_Key, _Tp> entries_;
};
}
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_FRAMEWORKS_COMMON_CONCURRENT_MAP_H

View File

@ -45,4 +45,4 @@ private:
} // namespace DistributedKv
} // namespace OHOS
#endif // DEV_IDEVICE_STATUS_CHANGE_LISTENER_H
#endif // DEV_IDEVICE_STATUS_CHANGE_LISTENER_H

View File

@ -178,6 +178,6 @@ public:
private:
static inline BrokerDelegator<KvStoreDataServiceProxy> delegator_;
};
}
} // namespace OHOS::DistributedKv
#endif // I_KV_STORE_DATA_SERVICE_H

View File

@ -23,6 +23,6 @@ enum class InnerStatus {
DECREASE_REFCOUNT,
ERROR,
};
}
}
} // namespace DistributedKv
} // namespace OHOS
#endif

View File

@ -170,6 +170,5 @@ private:
template<typename T>
static std::list<T> Convert2List(std::vector<T> &&entries);
};
}
} // namespace OHOS::DistributedKv
#endif

View File

@ -27,4 +27,4 @@ void DeviceStatusChangeListenerClient::OnChange(const DeviceInfo &results, const
listener_->OnDeviceChanged(results, type);
}
}
}
} // namespace OHOS::DistributedKv

View File

@ -73,4 +73,4 @@ int DeviceStatusChangeListenerStub::OnRemoteRequest(uint32_t code, MessageParcel
}
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -431,5 +431,4 @@ bool ITypesUtil::WriteVector(Parcel &parcel, const std::vector<T> &val, bool (Pa
}
return true;
}
}
} // namespace OHOS::DistributedKv

View File

@ -42,4 +42,4 @@ void KvStoreDeathRecipientImpl::OnRemoteDied()
}
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -33,4 +33,4 @@ friend struct KvStoreDeathRecipientImplCompare;
} // namespace DistributedKv
} // namespace OHOS
#endif // KVSTORE_DEATH_RECIPIENT_IMPL_H
#endif // KVSTORE_DEATH_RECIPIENT_IMPL_H

View File

@ -110,4 +110,4 @@ sptr<IKvStoreResultSet> KvStoreResultSetClient::GetKvStoreResultSetProxy() const
{
return kvStoreResultSetProxy_;
}
} // namespace OHOS::DistributedKv
} // namespace OHOS::DistributedKv

View File

@ -50,4 +50,4 @@ void KvStoreSyncCallbackClient::DeleteSyncCallback(uint64_t sequenceId)
syncCallbackInfo_.Erase(sequenceId);
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -47,4 +47,4 @@ void SyncObserver::SyncCompleted(const std::map<std::string, DistributedKv::Stat
callback->SyncCompleted(results);
}
}
}
} // namespace OHOS::DistributedKv

View File

@ -40,5 +40,5 @@ private:
std::recursive_mutex mutex_;
std::vector<std::shared_ptr<KvStoreSyncCallback>> callbacks_;
};
}
} // namespace OHOS::DistributedKv
#endif // DISTRIBUTEDDATAMGR_DATAMGR_SYNC_OBSERVER_H

View File

@ -248,4 +248,4 @@ HWTEST_F(BlobTest, Operator003, TestSize.Level0)
EXPECT_EQ(blob1 == blob2, false);
EXPECT_EQ(blob1.Empty(), true);
EXPECT_EQ(blob2.ToString(), "1234");
}
}

View File

@ -129,4 +129,4 @@ HWTEST_F(DistributedKvDataManagerEncryptTest, kvstore_ddm_createEncryptedStore_0
EXPECT_EQ(value, valueRet) << "value and valueRet are not equal";
kvStorePtr->ReleaseKvStoreSnapshot(snapshot);
}
}

View File

@ -2342,4 +2342,3 @@ HWTEST_F(LocalSubscribeStoreTest, ChangeNotificationMarshalling001, TestSize.Lev
EXPECT_EQ(changeOut->IsClear(), false);
delete changeOut;
}

View File

@ -165,7 +165,7 @@ void KvStoreSyncCallbackTestImpl::SyncCompleted(const std::map<std::string, Stat
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, GetStoreId001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, GetStoreId001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -180,7 +180,7 @@ HWTEST_F(SingleKvStoreClientTest, GetStoreId001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, PutGetDelete001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, PutGetDelete001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -217,7 +217,7 @@ HWTEST_F(SingleKvStoreClientTest, PutGetDelete001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, GetEntriesAndResultSet001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, GetEntriesAndResultSet001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -265,7 +265,7 @@ HWTEST_F(SingleKvStoreClientTest, GetEntriesAndResultSet001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, Subscribe001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, Subscribe001, TestSize.Level1)
{
auto observer = std::make_shared<KvStoreObserverTestImpl>();
auto subStatus = singleKvStorePtr->SubscribeKvStore(SubscribeType::SUBSCRIBE_TYPE_ALL, observer);
@ -285,7 +285,7 @@ HWTEST_F(SingleKvStoreClientTest, Subscribe001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, SyncCallback001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SyncCallback001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -313,7 +313,7 @@ HWTEST_F(SingleKvStoreClientTest, SyncCallback001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, RemoveDeviceData001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, RemoveDeviceData001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
@ -338,7 +338,7 @@ HWTEST_F(SingleKvStoreClientTest, RemoveDeviceData001 ,TestSize.Level1)
* @tc.require: SR000DORPS AR000DPRQ7 AR000DDPRPL
* @tc.author: hongbo
*/
HWTEST_F(SingleKvStoreClientTest, SyncData001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SyncData001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
std::string deviceId = "no_exist_device_id";
@ -354,7 +354,7 @@ HWTEST_F(SingleKvStoreClientTest, SyncData001 ,TestSize.Level1)
* @tc.require: AR000DPSF1
* @tc.author: YangLeda
*/
HWTEST_F(SingleKvStoreClientTest, TestSchemaStoreC001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, TestSchemaStoreC001, TestSize.Level1)
{
std::shared_ptr<SingleKvStore> schemaSingleKvStorePtr;
DistributedKvDataManager manager;
@ -384,7 +384,7 @@ HWTEST_F(SingleKvStoreClientTest, TestSchemaStoreC001 ,TestSize.Level1)
* @tc.require: SR000DOGQE AR000DPUAN
* @tc.author: wangtao
*/
HWTEST_F(SingleKvStoreClientTest, SyncData002 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SyncData002, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
std::string deviceId = "no_exist_device_id";
@ -401,7 +401,7 @@ HWTEST_F(SingleKvStoreClientTest, SyncData002 ,TestSize.Level1)
* @tc.require: SR000DOGQE AR000DPUAO
* @tc.author: wangtao
*/
HWTEST_F(SingleKvStoreClientTest, SetSync001 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SetSync001, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
KvSyncParam syncParam{ 500 }; // 500ms
@ -420,7 +420,7 @@ HWTEST_F(SingleKvStoreClientTest, SetSync001 ,TestSize.Level1)
* @tc.require: SR000DOGQE AR000DPUAO
* @tc.author: wangtao
*/
HWTEST_F(SingleKvStoreClientTest, SetSync002 ,TestSize.Level1)
HWTEST_F(SingleKvStoreClientTest, SetSync002, TestSize.Level1)
{
EXPECT_NE(singleKvStorePtr, nullptr) << "kvStorePtr is null.";
KvSyncParam syncParam2{ 50 }; // 50ms
@ -1104,4 +1104,3 @@ HWTEST_F(SingleKvStoreClientTest, UnSubscribeWithQuery001, TestSize.Level1)
auto unSubscribeStatus = singleKvStorePtr->UnsubscribeWithQuery(deviceIds, dataQuery);
EXPECT_NE(unSubscribeStatus, Status::SUCCESS) << "sync device should not return success";
}

View File

@ -51,5 +51,5 @@ protected:
virtual int32_t DoUnSubscribe(const RdbSyncerParam& param) = 0;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -28,5 +28,5 @@ class RdbManager {
public:
static std::shared_ptr<RdbService> GetRdbService(const RdbSyncerParam& param);
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -79,5 +79,5 @@ private:
RdbSyncCompleteNotifier completeNotifier_;
RdbDataChangeNotifier changeNotifier_;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -38,5 +38,5 @@ public:
virtual int32_t UnSubscribe(const RdbSyncerParam& param, const SubscribeOption& option,
RdbStoreObserver *observer) = 0;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -102,5 +102,5 @@ public:
struct DropOption {
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -21,4 +21,4 @@ std::shared_ptr<RdbService> RdbManager::GetRdbService(const RdbSyncerParam& para
{
return RdbManagerImpl::GetInstance().GetRdbService(param);
}
}
} // namespace OHOS::DistributedRdb

View File

@ -145,4 +145,4 @@ void RdbManagerImpl::ResetServiceHandle()
distributedDataMgr_ = nullptr;
rdbService_ = nullptr;
}
}
} // namespace OHOS::DistributedRdb

View File

@ -71,5 +71,5 @@ private:
std::shared_ptr<RdbService> rdbService_;
std::string bundleName_;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -164,4 +164,4 @@ int32_t RdbNotifierStub::OnChange(const std::string& storeName, const std::vecto
}
return RDB_OK;
}
}
} // namespace OHOS::DistributedRdb

View File

@ -375,4 +375,4 @@ void RdbServiceProxy::ImportObservers(ObserverMap &observers)
return false;
});
}
}
} // namespace OHOS::DistributedRdb

View File

@ -83,5 +83,5 @@ private:
static inline BrokerDelegator<RdbServiceProxy> delegator_;
};
}
} // namespace OHOS::DistributedRdb
#endif

View File

@ -22,6 +22,6 @@
namespace OHOS::DistributedData {
napi_status InitConstProperties(napi_env env, napi_value exports);
}
} // namespace OHOS::DistributedData
#endif // OHOS_JS_CONST_PROPERTIES_H

View File

@ -21,7 +21,7 @@
namespace OHOS::DistributedData {
class JsDeviceKVStore : public JsKVStore {
public:
JsDeviceKVStore(const std::string& storeId);
explicit JsDeviceKVStore(const std::string& storeId);
~JsDeviceKVStore() = default;
static napi_value Constructor(napi_env env);
@ -39,5 +39,5 @@ private:
static napi_value OnEvent(napi_env env, napi_callback_info info);
static napi_value OffEvent(napi_env env, napi_callback_info info);
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_DEVICE_KV_STORE_H

View File

@ -23,7 +23,7 @@ namespace OHOS::DistributedData {
class JsFieldNode {
public:
using json = nlohmann::json;
JsFieldNode(const std::string& fName);
explicit JsFieldNode(const std::string& fName);
~JsFieldNode() = default;
std::string GetFieldName();
@ -58,5 +58,5 @@ private:
bool isWithDefaultValue = false;
bool isNullable = false;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_FIELD_NODE_H

View File

@ -55,5 +55,5 @@ private:
std::list<std::shared_ptr<DeathRecipient>> deathRecipient_ {};
std::shared_ptr<UvQueue> uvQueue_;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_KV_MANAGER_H

View File

@ -35,7 +35,7 @@ enum {
*/
class JsKVStore {
public:
JsKVStore(const std::string& storeId);
explicit JsKVStore(const std::string& storeId);
virtual ~JsKVStore();
void SetNative(std::shared_ptr<DistributedKv::SingleKvStore>& kvStore);

View File

@ -46,6 +46,5 @@ private:
std::shared_ptr<DistributedKv::KvStoreResultSet> resultSet_ = nullptr;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_KV_STORE_RESELTSET_H

View File

@ -30,5 +30,5 @@ private:
std::shared_ptr<UvQueue> uvQueue_;
napi_ref callback_;
};
}
#endif // OHOS_JS_OBSERVER_H
} // namespace OHOS::DistributedData
#endif // OHOS_JS_OBSERVER_H

View File

@ -62,5 +62,5 @@ private:
private:
DistributedKv::DataQuery query_;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_QUERY_H

View File

@ -23,7 +23,7 @@
namespace OHOS::DistributedData {
class JsSchema {
public:
JsSchema(napi_env env);
explicit JsSchema(napi_env env);
~JsSchema();
static napi_value Constructor(napi_env env);
@ -59,5 +59,5 @@ private:
uint32_t mode = SCHEMA_MODE_SLOPPY;
uint32_t skip = 0;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_SCHEMA_H

View File

@ -21,7 +21,7 @@
namespace OHOS::DistributedData {
class JsSingleKVStore : public JsKVStore {
public:
JsSingleKVStore(const std::string& storeId);
explicit JsSingleKVStore(const std::string& storeId);
~JsSingleKVStore() = default;
static napi_value Constructor(napi_env env);
@ -40,5 +40,5 @@ private:
static napi_value SetSyncParam(napi_env env, napi_callback_info info);
static napi_value GetSecurityLevel(napi_env env, napi_callback_info info);
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_SINGLE_KV_STORE_H

View File

@ -173,5 +173,5 @@ private:
TUPLE_SIZE
};
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_JS_UTIL_H

View File

@ -112,5 +112,5 @@ private:
};
static void GenerateOutput(ContextBase* ctxt);
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_NAPI_QUEUE_H

View File

@ -39,5 +39,5 @@ private:
napi_env env_ = nullptr;
uv_loop_s* loop_ = nullptr;
};
}
} // namespace OHOS::DistributedData
#endif // OHOS_UV_QUEUE_H

View File

@ -140,4 +140,4 @@ napi_status InitConstProperties(napi_env env, napi_value exports)
return napi_define_properties(env, exports, count, properties);
}
}
} // namespace OHOS::DistributedData

View File

@ -274,4 +274,4 @@ std::string JsFieldNode::Dump()
};
return jsNode.dump();
}
}
} // namespace OHOS::DistributedData

View File

@ -373,4 +373,4 @@ void JsKVManager::DeathRecipient::OnRemoteDied()
{
AsyncCall();
}
}
} // namespace OHOS::DistributedData

View File

@ -271,4 +271,4 @@ napi_value JsKVStoreResultSet::GetEntry(napi_env env, napi_callback_info info) /
NAPI_ASSERT(env, ctxt->status == napi_ok, "GetEntry failed!");
return ctxt->output;
}
} //
} // namespace OHOS::DistributedData

View File

@ -57,4 +57,4 @@ void JSObserver::AsyncCall(UvQueue::NapiArgsGenerator genArgs)
return callback;
}, genArgs);
}
}
} // namespace OHOS::DistributedData

View File

@ -664,4 +664,4 @@ napi_value JsQuery::GetSqlLike(napi_env env, napi_callback_info info)
JSUtil::SetValue(env, query.ToString(), ctxt->output);
return ctxt->output;
}
} //
} // namespace OHOS::DistributedData

View File

@ -235,4 +235,4 @@ std::string JsSchema::Dump()
};
return js.dump();
}
}
} // namespace OHOS::DistributedData

View File

@ -737,7 +737,7 @@ napi_status JSUtil::GetValue(napi_env env, napi_value in, std::list<DistributedK
napi_status JSUtil::SetValue(napi_env env, const std::list<DistributedKv::Entry>& in, napi_value& out)
{
ZLOGD("napi_value <- std::list<DistributedKv::Entry> %{public}u", static_cast<int>(in.size()));
ZLOGD("napi_value <- std::list<DistributedKv::Entry> %{public}d", static_cast<int>(in.size()));
napi_status status = napi_create_array_with_length(env, in.size(), &out);
CHECK_RETURN(status == napi_ok, "create array failed!", status);
int index = 0;
@ -777,7 +777,7 @@ napi_status JSUtil::GetValue(napi_env env, napi_value in, std::vector<Distribute
napi_status JSUtil::SetValue(napi_env env, const std::vector<DistributedKv::Entry>& in, napi_value& out)
{
ZLOGD("napi_value <- std::vector<DistributedKv::Entry> %{public}u", static_cast<int>(in.size()));
ZLOGD("napi_value <- std::vector<DistributedKv::Entry> %{public}d", static_cast<int>(in.size()));
napi_status status = napi_create_array_with_length(env, in.size(), &out);
CHECK_RETURN(status == napi_ok, "create array failed!", status);
int index = 0;
@ -818,7 +818,7 @@ napi_status JSUtil::GetValue(napi_env env, napi_value in, std::vector<Distribute
napi_status JSUtil::SetValue(napi_env env, const std::vector<DistributedKv::StoreId>& in, napi_value& out)
{
ZLOGD("napi_value <- std::vector<DistributedKv::StoreId> %{public}u", static_cast<int>(in.size()));
ZLOGD("napi_value <- std::vector<DistributedKv::StoreId> %{public}d", static_cast<int>(in.size()));
napi_status status = napi_create_array_with_length(env, in.size(), &out);
CHECK_RETURN((status == napi_ok), "create_array failed!", status);
int index = 0;
@ -995,4 +995,4 @@ bool JSUtil::Equals(napi_env env, napi_value value, napi_ref copy)
napi_strict_equals(env, value, copyValue, &isEquals);
return isEquals;
}
} // OHOS::DistributedData
} // namespace OHOS::DistributedData

View File

@ -79,4 +79,4 @@ napi_env UvQueue::GetEnv()
{
return env_;
}
}
} // namespace OHOS::DistributedData

View File

@ -218,6 +218,6 @@ protected:
// Status of this control operation.
KVSTORE_API virtual Status Control(KvControlCmd cmd, const KvParam &inputParam, KvParam &output) = 0;
};
} // namespace AppDistributedKv
} // namespace DistributedKv
} // namespace OHOS
#endif // SINGLE_KV_STORE_H

View File

@ -161,4 +161,4 @@ std::string DirectoryUtils::IncludeDelimiterAtPathTail(const std::string &path)
return path;
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -106,4 +106,4 @@ HWTEST_F(KvSchedulerTest, KvSchedulerTest003, TestSize.Level1)
});
std::this_thread::sleep_for(std::chrono::seconds(5));
EXPECT_EQ(a, 3) << "KvSchedulerTest KvSchedulerTest003 failed";
}
}

View File

@ -127,4 +127,4 @@ HWTEST_F(KvStoreThreadPoolTest, TestApplyTask003, TestSize.Level1)
EXPECT_EQ(var, 0);
pool->Stop();
EXPECT_EQ(var, 8);
}
}

View File

@ -30,4 +30,4 @@ std::shared_ptr<BroadcastSender> BroadcastSender::GetInstance()
}
return instance_;
}
}
} // namespace OHOS::DistributedKv

View File

@ -60,4 +60,4 @@ void BroadcastSenderImpl::SendEvent(const EventParams &params)
CommonEventManager::UnSubscribeCommonEvent(subscriberPtr);
ZLOGI("SendEvent result:%{public}d.", result);
}
}
} // namespace OHOS::DistributedKv

View File

@ -26,5 +26,5 @@ private:
static const inline std::string ACTION_NAME = "DistributedDataMgrStarter";
static const inline std::string PKG_NAME = "pkgName";
};
}
} // namespace OHOS::DistributedKv
#endif // BROADCAST_SENDER_IMPL_H

View File

@ -72,4 +72,4 @@ size_t DataBuffer::GetBufUsed() const
return used_;
}
} // namespace AppDistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -68,6 +68,6 @@ union Head {
HeaderInfo headerInfo;
uint8_t headArray[DataBuffer::HEADER_LEN];
} __attribute__((packed));
}
}
} // namespace AppDistributedKv
} // namespace OHOS
#endif // DISTRIBUTEDDATAMGR_DATA_BUFFER_H

View File

@ -156,4 +156,4 @@ private:
};
} // namespace AppDistributedKv
} // namespace OHOS
#endif /* DISTRIBUTEDDATAFWK_SRC_SOFTBUS_ADAPTER_H */
#endif /* DISTRIBUTEDDATAFWK_SRC_SOFTBUS_ADAPTER_H */

View File

@ -109,5 +109,5 @@ bool DdsTrace::SetBytraceEnable()
ZLOGD("success, current tag is true");
return true;
}
} // namespace OHOS
} // namespace DistributedKv
} // namespace OHOS

View File

@ -23,4 +23,4 @@ ReportStatus CommunicationFaultImpl::Report(const FaultMsg &msg)
return ReportStatus::SUCCESS;
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -23,4 +23,4 @@ ReportStatus RuntimeFaultImpl::Report(const FaultMsg &msg)
return ReportStatus::SUCCESS;
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -23,4 +23,4 @@ ReportStatus ServiceFaultImpl::Report(const OHOS::DistributedKv::FaultMsg &msg)
return ReportStatus::SUCCESS;
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -80,4 +80,4 @@ StatisticReporter<ApiPerformanceStat>* Reporter::ApiPerformanceStatistic()
return &apiPerformanceStat;
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -18,4 +18,4 @@
namespace OHOS {
namespace DistributedKv {
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -23,4 +23,4 @@ ReportStatus TrafficStatisticImpl::Report(const TrafficStat &stat)
return ReportStatus::SUCCESS;
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -23,4 +23,4 @@ ReportStatus VisitStatisticImpl::Report(const VisitStat &stat)
return ReportStatus::SUCCESS;
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -54,7 +54,7 @@ HWTEST_F(DistributedataDfxMSTTest, Dfx001, TestSize.Level0)
*/
auto comFault = Reporter::GetInstance()->CommunicationFault();
EXPECT_NE(nullptr, comFault);
struct FaultMsg msg{.faultType= FaultType::SERVICE_FAULT, .moduleName = "comm", .interfaceName = "sendData",
struct FaultMsg msg{.faultType = FaultType::SERVICE_FAULT, .moduleName = "comm", .interfaceName = "sendData",
.errorType = Fault::CF_CREATE_SESSION};
auto repStatus = comFault->Report(msg);
EXPECT_TRUE(repStatus == ReportStatus::SUCCESS);

View File

@ -62,7 +62,7 @@ HWTEST_F(DistributedataDfxUTTest, Dfx001, TestSize.Level0)
*/
auto comFault = Reporter::GetInstance()->CommunicationFault();
EXPECT_NE(nullptr, comFault);
struct FaultMsg msg{.faultType= FaultType::SERVICE_FAULT, .moduleName = "comm", .interfaceName = "sendData",
struct FaultMsg msg{.faultType = FaultType::SERVICE_FAULT, .moduleName = "comm", .interfaceName = "sendData",
.errorType = Fault::CF_CREATE_SESSION};
auto repStatus = comFault->Report(msg);
EXPECT_TRUE(repStatus == ReportStatus::SUCCESS);
@ -97,7 +97,7 @@ HWTEST_F(DistributedataDfxUTTest, Dfx002, TestSize.Level0)
*/
auto dbFault = Reporter::GetInstance()->DatabaseFault();
EXPECT_NE(nullptr, dbFault);
struct FaultMsg msg{.faultType= FaultType::SERVICE_FAULT, .moduleName = "database",
struct FaultMsg msg{.faultType = FaultType::SERVICE_FAULT, .moduleName = "database",
.interfaceName = "getKvStore",
.errorType = Fault::DF_DB_DAMAGE};
auto repStatus = dbFault->Report(msg);

View File

@ -182,4 +182,3 @@ T Constant::TrimCopy(T s)
} // namespace DistributedKv
} // namespace OHOS
#endif // KV_DATASERVICE_CONSTANT_H

View File

@ -47,4 +47,4 @@ private:
};
} // namespace DistributedKv
} // namespace OHOS
#endif // DIRECTORY_UTILS_H
#endif // DIRECTORY_UTILS_H

View File

@ -51,5 +51,5 @@ private:
std::unique_ptr<std::thread> thread_;
std::condition_variable condition_;
};
} // namespace DistributedKv::OHOS
} // namespace OHOS::DistributedKv
#endif // KV_SCHEDULER_H

View File

@ -22,4 +22,4 @@
#define OS_OHOS
#endif
#endif // PLATFORM_SPECIFIC_H
#endif // PLATFORM_SPECIFIC_H

View File

@ -35,4 +35,4 @@ public:
};
} // namespace DistributedKv
} // namespace OHOS
#endif
#endif

View File

@ -37,5 +37,5 @@ private:
static std::mutex mutex_;
static std::shared_ptr<BroadcastSender> instance_;
};
}
} // namespace OHOS::DistributedKv
#endif // BROADCAST_SENDER_H

View File

@ -47,6 +47,6 @@ private:
uint32_t traceCount{ 0 };
bool isSendToHiview{ false };
};
} // namespace OHOS
} // namespace DistributedKv
} // namespace OHOS
#endif

View File

@ -74,5 +74,5 @@ bool MeidaLibChecker::IsValid(pid_t uid, const std::string &bundleName)
return true;
}
}
}
} // namespace DistributedData
} // namespace OHOS

View File

@ -32,7 +32,7 @@ private:
static constexpr pid_t SYSTEM_UID = 10000;
std::map<std::string, std::string> trusts_;
};
}
}
} // namespace DistributedData
} // namespace OHOS
#endif // OHOS_DISTRIBUTED_DATA_SERVICES_DISTRIBUTEDDATASERVICE_ADAPTER_PERMISSION_SRC_MEIDA_LIB_CHECKER_H

View File

@ -41,4 +41,4 @@ AppDistributedKv::ChangeLevelType DeviceChangeListenerImpl::GetChangeLevelType()
{
return AppDistributedKv::ChangeLevelType::MIN;
}
}
} // namespace OHOS::DistributedKv

View File

@ -32,5 +32,5 @@ public:
private:
std::map<IRemoteObject *, sptr<IDeviceStatusChangeListener>> &observers_;
};
}
} // namespace OHOS::DistributedKv
#endif // DEV_DEVICE_CHANGE_LISTENER_IMPL_H

View File

@ -238,4 +238,4 @@ KvStoreResultSetImpl *DeviceKvStoreImpl::CreateResultSet(
{
return new (std::nothrow) DeviceKvStoreResultSetImpl(resultSet, prix);
}
}
} // namespace OHOS::DistributedKv

View File

@ -49,5 +49,5 @@ private:
void DeletePrefixAndSuffix(const Key &in, std::vector<uint8_t> &out);
static std::string localDeviceId_;
};
}
} // namespace OHOS::DistributedKv
#endif // DEVICE_KVSTORE_IMPL_H

View File

@ -81,4 +81,4 @@ void DeviceKvStoreObserverImpl::Transfer(const std::list<DistributedDB::Entry> &
output.push_back(tmpEntry);
}
}
}
} // namespace OHOS::DistributedKv

View File

@ -29,5 +29,5 @@ private:
std::string localDeviceId_;
sptr<IKvStoreObserver> observerProxy_;
};
}
} // namespace OHOS::DistributedKv
#endif // DEVICE_KVSTORE_OBSERVER_IMPL_H

View File

@ -49,4 +49,4 @@ Status DeviceKvStoreResultSetImpl::GetEntry(Entry &entry)
ZLOGD("RS end.");
return Status::SUCCESS;
}
}
} // namespace OHOS::DistributedKv

View File

@ -24,6 +24,6 @@ public:
explicit DeviceKvStoreResultSetImpl(DistributedDB::KvStoreResultSet *resultSet, DistributedDB::Key keyPrefix = {});
Status GetEntry(Entry &entry) override;
};
}
} // namespace OHOS::DistributedKv
#endif // DEVICE_KVSTORE_RESULTSET_IMPL_H

View File

@ -70,5 +70,5 @@ bool KvStoreFlowCtrlManager::IsTokenEnoughSlice(TokenBucket &tokenBucket, uint64
return tokenBucket.leftNumInTokenBucket >= 1;
}
}
}
}
} // namespace DistributedKv
} // namespace OHOS

View File

@ -55,7 +55,7 @@ private:
TokenBucket sustainedTokenBucket_; // token bucket to deal with sustained events.
};
}
}
} // namespace DistributedKv
} // namespace OHOS
#endif // FOUNDATION_KVSTORE_FLOW_CTRL_MANAGER_H

View File

@ -35,4 +35,4 @@ void KvStoreAccountObserver::OnAccountChanged(const AccountEventInfo &eventInfo)
ZLOGI("account event %d, end.", eventInfo.status);
}
} // namespace DistributedKv
} // namespace OHOS
} // namespace OHOS

View File

@ -120,4 +120,4 @@ void KvStoreAppAccessor::OnCallback(const std::string &userId, const std::string
ZLOGD("AppId:%s is closed.", appId.c_str());
}
}
}
} // namespace OHOS::DistributedKv

View File

@ -44,5 +44,5 @@ public:
private:
KvStoreAppAccessor();
};
}
} // namespace OHOS::DistributedKv
#endif // KVSTORE_APP_ACCESSOR_H

View File

@ -1387,4 +1387,4 @@ void DbMetaCallbackDelegateMgr::GetKvStoreKeys(std::vector<StoreInfo> &dbStats)
}
delegate_->CloseKvStore(kvStoreNbDelegatePtr);
}
} // namespace OHOS::DistributedKv
} // namespace OHOS::DistributedKv

View File

@ -34,4 +34,4 @@ KvStoreDeviceListener::KvStoreDeviceListener(KvStoreDataService &kvStoreDataServ
: kvStoreDataService_(kvStoreDataService)
{
}
} // namespace OHOS::DistributedKv
} // namespace OHOS::DistributedKv

View File

@ -218,4 +218,4 @@ Status KvStoreResultSetImpl::MigrateKvStore(DistributedDB::KvStoreNbDelegate *kv
return Status::SUCCESS;
}
} // namespace OHOS::DistributedKv
} // namespace OHOS::DistributedKv

View File

@ -257,4 +257,4 @@ DBStatus Security::GetDirSecurityOption(const std::string &filePath, SecurityOpt
ZLOGI("the filePath is a directory!");
return DBStatus::NOT_SUPPORT;
}
}
} // namespace OHOS::DistributedKv

View File

@ -22,4 +22,4 @@ Uninstaller &Uninstaller::GetInstance()
static UninstallerImpl uninstaller;
return uninstaller;
}
}
} // namespace OHOS::DistributedKv

View File

@ -30,5 +30,5 @@ public:
KVSTORE_API virtual ~Uninstaller() {};
KVSTORE_API static Uninstaller &GetInstance();
};
}
} // namespace OHOS::DistributedKv
#endif // DISTRIBUTEDDATAMGR_UNINSTALLER_H

Some files were not shown because too many files have changed in this diff Show More