issue modifies

Signed-off-by: qian-nan-xu <xuqiannan@huawei.com>
This commit is contained in:
qian-nan-xu
2022-04-02 10:54:34 +08:00
parent 417bec6a1d
commit 1e68e59cfb
129 changed files with 239 additions and 238 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2021-2022 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
@@ -22,6 +22,7 @@ ohos_hap("Contacts_DataAbility") {
hap_name = "Contacts_DataAbility"
part_name = "contactsdata_hap"
subsystem_name = "applications"
module_install_dir = "app/com.ohos.contactsdataability"
}
## Build contactsdataability.so {{{
+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
<!-- Copyright (c) 2021-2022 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.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -147,14 +147,14 @@ int DataBaseDisasterRecovery::BackDatabase(std::string dataBaseName)
values.PutString(DatabaseBackupColumns::BACKUP_PATH, dbPath);
int ret = store_->Insert(outRowId, ContactTableName::DATABASE_BACKUP_TASK, values);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("DataBaseDisasterRecovery Insert filed, status is %{public}d.", ret);
HILOG_ERROR("DataBaseDisasterRecovery Insert failed, status is %{public}d.", ret);
g_mtx.unlock();
return RDB_EXECUTE_FAIL;
}
OHOS::NativeRdb::RdbHelper::DeleteRdbStore(dbPath);
ret = store_->Backup(dbPath, std::vector<uint8_t>());
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("DataBaseDisasterRecovery Backup filed, status is %{public}d.", ret);
HILOG_ERROR("DataBaseDisasterRecovery Backup failed, status is %{public}d.", ret);
g_mtx.unlock();
return RDB_EXECUTE_FAIL;
}
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+9 -9
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -32,12 +32,12 @@ CandidateStatus::~CandidateStatus()
}
/**
* @brief Query operation for merge candidate
* @brief Query operation for merging candidates
*
* @param store Conditions for query operation
* @param rawId Contacts's raw_contact_id to query
*
* @return Candidate contact raw_contact_id collection
* @return Collection of canddidate contacts with the same raw_contact_id
*/
Candidate CandidateStatus::QueryAllForMerge(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId)
{
@@ -47,7 +47,7 @@ Candidate CandidateStatus::QueryAllForMerge(std::shared_ptr<OHOS::NativeRdb::Rdb
int phoneType = contactsDataBase->GetTypeId(ContentTypeData::PHONE);
MergeUtils mergeUtils;
std::set<std::string> names = mergeUtils.QueryRawContactByType(store, rawId, nameType);
// query other name same raw_contact_id
// query other name with the raw_contact_id
std::vector<int> nameIds = mergeUtils.QueryByDataName(rawId, names, store);
// query current phone
std::set<std::string> phones = mergeUtils.QueryRawContactByType(store, rawId, phoneType);
@@ -94,12 +94,12 @@ void CandidateStatus::AddMergedStatus(Candidate &candidate)
}
/**
* @brief Query operation for ensure if candidate need merge
* @brief Query operation for checking if candidate marging is needed
*
* @param store Conditions for query operation
* @param rawId Contacts's raw_contact_id to query
*
* @return The result returned by the update operation
* @return The result returned by the query operation
*/
bool CandidateStatus::IsNeedMerge(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId)
{
@@ -129,7 +129,7 @@ bool CandidateStatus::IsNeedMerge(std::shared_ptr<OHOS::NativeRdb::RdbStore> sto
}
/**
* @brief Query operation for ensure if candidate has true merge_status
* @brief Check if the candidate has true merge_status
*
* @param store Conditions for query operation
* @param rawId Contacts's raw_contact_id to query
@@ -164,12 +164,12 @@ bool CandidateStatus::IsMergeStatus(std::shared_ptr<OHOS::NativeRdb::RdbStore> s
}
/**
* @brief Query operation for ensure if candidate has merged
* @brief Check if the candidate has been merged
*
* @param store Conditions for query operation
* @param rawId Contacts's raw_contact_id to query
*
* @return The result returned by the update operation
* @return True if the candidate has been merged; false otherwise
*/
bool CandidateStatus::IsMerged(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId)
{
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -34,7 +34,7 @@ Contacts::~Contacts()
*
* @param rdbStore Database operation object
* @param outRawContactId raw_contact table id
* @param rawContactValues insert raw_contact values
* @param rawContactValues inserted raw_contact values
* @param contactId contact_id address
*
* @return insert contact error or success code
@@ -66,7 +66,7 @@ int Contacts::UpdateContact(const int &rawContactId, std::shared_ptr<OHOS::Nativ
/**
* @brief Build conatct data
*
* @param rawContactValues insert contact values
* @param rawContactValues inserted contact values
*
* @return contact table values
*/
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -42,7 +42,7 @@ ContactsAccount::~ContactsAccount()
/**
* @brief ContactsAccount insert database
*
* @param rdbStore Insert operation based on radStore
* @param rdbStore Insert operation based on rdbStore
* @param accountName Pass in parameter accountName
* @param accountType Pass in parameter accountType
*
@@ -57,7 +57,7 @@ int64_t ContactsAccount::Insert(
values.PutString(AccountColumns::ACCOUNT_TYPE, accountType);
int64_t outRowId = OHOS::NativeRdb::E_OK;
if (store_ == nullptr) {
HILOG_ERROR("ContactsAccount insert store_ is nullptr");
HILOG_ERROR("ContactsAccount insert store_ is nullptr");
return RDB_OBJECT_EMPTY;
}
int ret = store_->Insert(outRowId, ContactTableName::ACCOUNT, values);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -105,7 +105,7 @@ bool ContactsDataAbility::IsBeginTransactionOK(int code, std::mutex &mutex)
{
mutex.try_lock();
if (code != 0) {
HILOG_ERROR("IsBeginTransactionOK fail");
HILOG_ERROR("IsBeginTransactionOK failed");
mutex.unlock();
return false;
}
@@ -124,7 +124,7 @@ bool ContactsDataAbility::IsCommitOK(int code, std::mutex &mutex)
{
mutex.try_lock();
if (code != 0) {
HILOG_ERROR("IsCommitOK fail");
HILOG_ERROR("IsCommitOK failed");
mutex.unlock();
return false;
}
@@ -145,7 +145,7 @@ int ContactsDataAbility::Insert(const Uri &uri, const NativeRdb::ValuesBucket &v
Contacts::SqlAnalyzer sqlAnalyzer;
bool isOk = sqlAnalyzer.CheckValuesBucket(value);
if (!isOk) {
HILOG_ERROR("ContactsDataAbility CheckValuesBucket is error");
HILOG_ERROR("ContactsDataAbility CheckValuesBucket error");
return Contacts::RDB_EXECUTE_FAIL;
}
g_mutex.lock();
@@ -278,7 +278,7 @@ int ContactsDataAbility::Update(
Contacts::SqlAnalyzer sqlAnalyzer;
bool isOk = sqlAnalyzer.CheckValuesBucket(value);
if (!isOk) {
HILOG_ERROR("ContactsDataAbility CheckValuesBucket is error");
HILOG_ERROR("ContactsDataAbility CheckValuesBucket error");
return Contacts::RDB_EXECUTE_FAIL;
}
g_mutex.lock();
@@ -447,9 +447,9 @@ void ContactsDataAbility::DeleteExecute(
*
* @param uri Determine the data table name based on the URI
* @param columns Conditions for query operation
* @param predicates Query the data values of the condition
* @param predicates Condition for querying data values
*
* @return Query database results
* @return Database query result
*/
std::shared_ptr<NativeRdb::AbsSharedResultSet> ContactsDataAbility::Query(
const Uri &uri, const std::vector<std::string> &columns, const NativeRdb::DataAbilityPredicates &predicates)
@@ -546,7 +546,7 @@ void ContactsDataAbility::QueryExecuteSwitchSplit(std::shared_ptr<NativeRdb::Abs
result = contactDataBase_->Query(rdbPredicates, columnsTemp);
break;
default:
HILOG_ERROR("ContactsDataAbility ====>no match uri action");
HILOG_ERROR("ContactsDataAbility ====>no matching uri action");
break;
}
}
+27 -27
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -69,7 +69,7 @@ ContactsDataBase::ContactsDataBase()
}
}
if (errCode != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsDataBase rebase open error :%{public}d", errCode);
HILOG_ERROR("ContactsDataBase open error :%{public}d", errCode);
return;
}
store_ = contactStore_;
@@ -101,7 +101,7 @@ int ContactsDataBase::BeginTransaction()
}
int ret = store_->BeginTransaction();
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsDataBase BeginTransaction fail :%{public}d", ret);
HILOG_ERROR("ContactsDataBase BeginTransaction failed :%{public}d", ret);
}
return ret;
}
@@ -114,7 +114,7 @@ int ContactsDataBase::Commit()
}
int ret = store_->Commit();
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsDataBase Commit fail :%{public}d", ret);
HILOG_ERROR("ContactsDataBase Commit failed :%{public}d", ret);
}
return ret;
}
@@ -127,7 +127,7 @@ int ContactsDataBase::RollBack()
}
int ret = store_->RollBack();
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsDataBase RollBack fail :%{public}d", ret);
HILOG_ERROR("ContactsDataBase RollBack failed :%{public}d", ret);
}
return ret;
}
@@ -154,14 +154,14 @@ int64_t ContactsDataBase::InsertRawContact(std::string table, OHOS::NativeRdb::V
int64_t outRawContactId = 0;
int rowRet = rawContacts.InsertRawContact(store_, outRawContactId, rawContactValues);
if (rowRet != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("InsertRawContact insertRawContact fail:%{public}d", rowRet);
HILOG_ERROR("InsertRawContact insertRawContact failed:%{public}d", rowRet);
return RDB_EXECUTE_FAIL;
}
Contacts contactsContact;
int64_t contactId = 0;
int rowContactRet = contactsContact.InsertContact(store_, outRawContactId, rawContactValues, contactId);
if (rowContactRet != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("InsertRawContact insertContact fail:%{public}d", rowContactRet);
HILOG_ERROR("InsertRawContact insertContact failed:%{public}d", rowContactRet);
return RDB_EXECUTE_FAIL;
}
// update contactId to rawContacts
@@ -174,7 +174,7 @@ int64_t ContactsDataBase::InsertRawContact(std::string table, OHOS::NativeRdb::V
upWhereArgs.push_back(std::to_string(outRawContactId));
int ret = rawContacts.UpdateRawContact(store_, upRawContactValues, upWhereClause, upWhereArgs);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("insertRawContact Update contactId to rawContacts fail:%{public}d", rowContactRet);
HILOG_ERROR("insertRawContact Update contactId to rawContacts failed:%{public}d", rowContactRet);
return RDB_EXECUTE_FAIL;
}
// insert search
@@ -183,7 +183,7 @@ int64_t ContactsDataBase::InsertRawContact(std::string table, OHOS::NativeRdb::V
int rowSearchContactRet =
contactsSearch.Insert(store_, contactId, outRawContactId, rawContactValues, searchContactId);
if (rowSearchContactRet != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("InsertRawContact insertSearchContact fail:%{public}d", rowSearchContactRet);
HILOG_ERROR("InsertRawContact insertSearchContact failed:%{public}d", rowSearchContactRet);
return RDB_EXECUTE_FAIL;
}
return outRawContactId;
@@ -245,7 +245,7 @@ int64_t ContactsDataBase::InsertContactData(std::string table, OHOS::NativeRdb::
std::string typeText;
int retCode = GetTypeText(contactDataValues, typeId, rawContactId, typeText);
if (retCode != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("InsertContactData getTypeText fail:%{public}d", retCode);
HILOG_ERROR("InsertContactData getTypeText failed:%{public}d", retCode);
return retCode;
}
if (typeId <= 0) {
@@ -258,7 +258,7 @@ int64_t ContactsDataBase::InsertContactData(std::string table, OHOS::NativeRdb::
int64_t outDataRowId;
int ret = store_->Insert(outDataRowId, table, contactDataValues);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("InsertContactData fail:%{public}d", ret);
HILOG_ERROR("InsertContactData failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
std::vector<int> rawContactIdVector;
@@ -269,7 +269,7 @@ int64_t ContactsDataBase::InsertContactData(std::string table, OHOS::NativeRdb::
int updateDisplayRet =
contactsUpdateHelper.UpdateDisplay(rawContactIdVector, typeTextVector, store_, contactDataValues, false);
if (updateDisplayRet != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("InsertContactData UpdateDisplay fail:%{public}d", updateDisplayRet);
HILOG_ERROR("InsertContactData UpdateDisplay failed:%{public}d", updateDisplayRet);
return RDB_EXECUTE_FAIL;
}
MergeUpdateTask(store_, rawContactIdVector, false);
@@ -331,7 +331,7 @@ int64_t ContactsDataBase::InsertGroup(std::string table, OHOS::NativeRdb::Values
int64_t outGroupRowId = OHOS::NativeRdb::E_OK;
int ret = store_->Insert(outGroupRowId, table, initialValues);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("InsertGroup fail:%{public}d", ret);
HILOG_ERROR("InsertGroup failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
return outGroupRowId;
@@ -380,14 +380,14 @@ int ContactsDataBase::UpdateContactData(
ret = store_->Update(changedRows, contactDataValues, rdbPredicates);
if (ret != OHOS::NativeRdb::E_OK) {
RollBack();
HILOG_ERROR("UpdateContactData fail:%{public}d", ret);
HILOG_ERROR("UpdateContactData failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
ContactsUpdateHelper contactsUpdateHelper;
ret = contactsUpdateHelper.UpdateDisplay(rawContactIdVector, types, store_, contactDataValues, false);
if (ret != OHOS::NativeRdb::E_OK) {
RollBack();
HILOG_ERROR("UpdateContactData UpdateDisplay fail:%{public}d", ret);
HILOG_ERROR("UpdateContactData UpdateDisplay failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
ret = Commit();
@@ -432,7 +432,7 @@ int ContactsDataBase::UpdateRawContact(
int changedRows = OHOS::NativeRdb::E_OK;
int ret = store_->Update(changedRows, values, rdbPredicates);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("UpdateRawContact fail:%{public}d", ret);
HILOG_ERROR("UpdateRawContact failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
// add Restore contact judgment
@@ -467,7 +467,7 @@ int ContactsDataBase::UpdateBlockList(
int changedRows = OHOS::NativeRdb::E_OK;
int ret = store_->Update(changedRows, values, rdbPredicates);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("UpdateBlockList fail:%{public}d", ret);
HILOG_ERROR("UpdateBlockList failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
HILOG_INFO("UpdateBlockList row:%{public}d", changedRows);
@@ -491,7 +491,7 @@ int ContactsDataBase::UpdateGroup(OHOS::NativeRdb::ValuesBucket values, OHOS::Na
int changedRows = OHOS::NativeRdb::E_OK;
int ret = store_->Update(changedRows, values, rdbPredicates);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("UpdateGroup fail:%{public}d", ret);
HILOG_ERROR("UpdateGroup failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
HILOG_INFO("UpdateGroup row:%{public}d", changedRows);
@@ -514,7 +514,7 @@ int ContactsDataBase::DeleteBlockList(OHOS::NativeRdb::RdbPredicates &rdbPredica
int changedRows = OHOS::NativeRdb::E_OK;
int ret = store_->Delete(changedRows, rdbPredicates);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("DeleteBlockList fail:%{public}d", ret);
HILOG_ERROR("DeleteBlockList failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
HILOG_INFO("DeleteBlockList row:%{public}d", changedRows);
@@ -537,7 +537,7 @@ int ContactsDataBase::DeleteGroup(OHOS::NativeRdb::RdbPredicates &rdbPredicates)
int deletedRows = OHOS::NativeRdb::E_OK;
int ret = store_->Delete(deletedRows, rdbPredicates);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("DeleteGroup fail:%{public}d", ret);
HILOG_ERROR("DeleteGroup failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
HILOG_INFO("DeleteGroup row:%{public}d", deletedRows);
@@ -553,7 +553,7 @@ int ContactsDataBase::DeleteRecord(OHOS::NativeRdb::RdbPredicates &rdbPredicates
int deletedRows = OHOS::NativeRdb::E_OK;
int ret = store_->Delete(deletedRows, rdbPredicates);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("DeleteRecord raw_contact_deleted fail:%{public}d", ret);
HILOG_ERROR("DeleteRecord raw_contact_deleted failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
HILOG_INFO("DeleteRecord raw_contact_deleted row:%{public}d", deletedRows);
@@ -587,7 +587,7 @@ int ContactsDataBase::DeleteContactData(OHOS::NativeRdb::RdbPredicates &rdbPredi
contactsUpdateHelper.UpdateDisplay(rawContactIdVector, types, store_, contactDataValues, true);
if (updateDisplayRet != OHOS::NativeRdb::E_OK) {
RollBack();
HILOG_ERROR("deleteContactData UpdateDisplay fail:%{public}d", updateDisplayRet);
HILOG_ERROR("deleteContactData UpdateDisplay failed:%{public}d", updateDisplayRet);
return RDB_EXECUTE_FAIL;
}
ret = Commit();
@@ -666,7 +666,7 @@ int ContactsDataBase::DeleteExecute(std::vector<OHOS::NativeRdb::ValuesBucket> &
upWhereArgs.push_back(std::to_string(rawContactId));
ret = store_->Update(updateRow, ContactTableName::RAW_CONTACT, values, upWhere, upWhereArgs);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("deleteRawContact upResultDelete fail:%{public}d", ret);
HILOG_ERROR("deleteRawContact upResultDelete failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
}
@@ -703,7 +703,7 @@ void ContactsDataBase::DeleteRecordInsert(
}
int deleteRet = DeleteRawContactLocal(contactId, rawContactId, backupData, disPlayName);
if (deleteRet != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("deleteRawContact upResultDelete fail:%{public}d", deleteRet);
HILOG_ERROR("deleteRawContact upResultDelete failed:%{public}d", deleteRet);
}
std::vector<int> rawContactIdVector;
rawContactIdVector.push_back(rawContactId);
@@ -810,7 +810,7 @@ int ContactsDataBase::DeleteRawContactLocal(
int64_t outRowId = OHOS::NativeRdb::E_OK;
int ret = store_->Insert(outRowId, ContactTableName::DELETE_RAW_CONTACT, deleteRawContact);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("deleteRawContact deleteInsert fail:%{public}d", ret);
HILOG_ERROR("deleteRawContact deleteInsert failed:%{public}d", ret);
return RDB_EXECUTE_FAIL;
}
return ret;
@@ -860,7 +860,7 @@ int ContactsDataBase::CompletelyDelete(OHOS::NativeRdb::RdbPredicates &rdbPredic
}
contactIdSet->Close();
if (retCode != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("CompletelyDelete for error:%{public}d", retCode);
HILOG_ERROR("CompletelyDelete error:%{public}d", retCode);
RollBack();
return retCode;
}
@@ -976,7 +976,7 @@ std::vector<int> ContactsDataBase::QueryContactDataRawContactId(
* @param rdbPredicates Conditions for query operation
* @param columns Conditions for query operation
*
* @return The result returned by the delete operation
* @return The result returned by the query operation
*/
std::unique_ptr<OHOS::NativeRdb::AbsSharedResultSet> ContactsDataBase::Query(
OHOS::NativeRdb::RdbPredicates &rdbPredicates, std::vector<std::string> &columns)
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -64,8 +64,8 @@ int ContactsUpdateHelper::UpdateDisplay(std::vector<int> rawContactIdVector, std
}
ret = rawContacts.UpdateRawContactById(rawContactId, type, rdbStore, rawContactValues);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact fail type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact fail:%{public}d", ret);
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact failed type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact failed:%{public}d", ret);
return ret;
}
OHOS::NativeRdb::ValuesBucket contactValues = GetUpdateCompanyValuesBucket(contactDataDataValues, isDelete);
@@ -74,15 +74,15 @@ int ContactsUpdateHelper::UpdateDisplay(std::vector<int> rawContactIdVector, std
}
ret = contactsContact.UpdateContact(rawContactId, rdbStore, contactValues);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateContact fail type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateContact fail:%{public}d", ret);
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateContact failed type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateContact failed:%{public}d", ret);
return ret;
}
} else if (strcmp(type.c_str(), ContentTypeData::NAME) == 0) {
ret = UpdateName(contactDataDataValues, isDelete, rawContactId, type, rdbStore);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact fail type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact fail:%{public}d", ret);
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact failed type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact failed:%{public}d", ret);
return ret;
}
} else {
@@ -131,8 +131,8 @@ int ContactsUpdateHelper::UpdateName(OHOS::NativeRdb::ValuesBucket linkDataDataV
RawContacts rawContacts;
rawContacts.UpdateRawContactById(rawContactId, type, rdbStore, rawContactValues);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact fail type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact fail:%{public}d", ret);
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact failed type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateRawContact failed:%{public}d", ret);
return ret;
}
}
@@ -141,8 +141,8 @@ int ContactsUpdateHelper::UpdateName(OHOS::NativeRdb::ValuesBucket linkDataDataV
ContactsSearch contactsSearch;
ret = contactsSearch.UpdateSearchContact(rawContactId, type, rdbStore, searchContactValues);
if (ret != OHOS::NativeRdb::E_OK) {
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateSearchContact fail type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateSearchContact fail:%{public}d", ret);
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateSearchContact failed type:%{public}s", type.c_str());
HILOG_ERROR("ContactsUpdateHelper UpdateDisplay UpdateSearchContact failed:%{public}d", ret);
return ret;
}
}
@@ -150,7 +150,7 @@ int ContactsUpdateHelper::UpdateName(OHOS::NativeRdb::ValuesBucket linkDataDataV
}
/**
* @brief ContactsUpdateHelper update table calllog by phoneNumber
* @brief ContactsUpdateHelper update table calllog
*
* @param rawContactIdVector Contacts ID collection to update
* @param rdbStore Conditions to update calllog
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+4 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -32,7 +32,7 @@ RawContacts::~RawContacts()
/**
* @brief RawContacts insert table raw_contact
*
* @param rdbStore Insert operation based on radStore
* @param rdbStore Insert operation based on rdbStore
* @param rawContactValues Pass in parameter rawContactValues
*
* @return Insert database results code
@@ -50,12 +50,12 @@ int RawContacts::InsertRawContact(std::shared_ptr<OHOS::NativeRdb::RdbStore> rdb
/**
* @brief RawContacts update table raw_contact
*
* @param rdbStore Update operation based on radStore
* @param rdbStore Update operation based on rdbStore
* @param upRawContactValues Pass in parameter upRawContactValues
* @param whereClause Conditions for update operation
* @param whereArgs Conditions for update operation
*
* @return Insert database results code
* @return Update database results code
*/
int RawContacts::UpdateRawContact(std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore,
OHOS::NativeRdb::ValuesBucket upRawContactValues, std::string whereClause, std::vector<std::string> whereArgs)
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 51 KiB

+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -494,7 +494,7 @@ describe('CalllogTest', function() {
{
var resultColumns = [ "id", "phone_number" ];
var condition = new ohos_data_ability.DataAbilityPredicates();
condition.like("phone_number", phoneNumber_Test + "%");
condition.like("phone_number", "%" + phoneNumber_Test);
try {
var resultSet = await DAHelper.query(calllogUri, resultColumns, condition);
if (resultSet.goToFirstRow()) {
+6 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1548,7 +1548,7 @@ describe('ContactCardTest', function() {
/**
* @tc.number contactCard_insert_test_2700
* @tc.name Insert contact blacklist
* @tc.name Insert contact blocklist
* @tc.desc Function test
*/
it("contactCard_insert_test_2700", 0, async function(done) {
@@ -1573,7 +1573,7 @@ describe('ContactCardTest', function() {
/**
* @tc.number contactCard_delete_test_2800
* @tc.name Delete contact blacklist
* @tc.name Delete contact blocklist
* @tc.desc Function test
*/
it("contactCard_delete_test_2800", 0, async function(done) {
@@ -2712,7 +2712,7 @@ describe('ContactCardTest', function() {
/**
* @tc.number contactCard_batchinsert_test_5400
* @tc.name Batch operation of contact blacklist
* @tc.name Batch operation of contact blocklist
* @tc.desc Function test
*/
it("contactCard_batchinsert_test_5400", 0, async function(done) {
@@ -4749,7 +4749,7 @@ describe('ContactCardTest', function() {
/**
* @tc.number contactCard_insertContactBlocklist_test_6800
* @tc.name Add multiple records to the blacklist and verify whether the insertion is successful
* @tc.name Add multiple records to the blocklist and verify whether the insertion is successful
* @tc.desc Function test
*/
it("contactCard_insertContactBlocklist_test_6800", 0, async function(done) {
@@ -4796,7 +4796,7 @@ describe('ContactCardTest', function() {
/**
* @tc.number contactCard_removeContactBlocklist_test_6900
* @tc.name Delete multiple records from the blacklist and verify whether the deletion is successful
* @tc.name Delete multiple records from the blocklist and verify whether the deletion is successful
* @tc.desc Function test
*/
it("contactCard_removeContactBlocklist_test_6900", 0, async function(done) {
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+8 -8
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -1547,7 +1547,7 @@ describe('ContactsTest', function() {
/**
* @tc.number contact_insert_test_2700
* @tc.name Insert contact blacklist
* @tc.name Insert contact blocklist
* @tc.desc Function test
*/
it("contact_insert_test_2700", 0, async function(done) {
@@ -1572,7 +1572,7 @@ describe('ContactsTest', function() {
/**
* @tc.number contact_delete_test_2800
* @tc.name Delete contact blacklist
* @tc.name Delete contact blocklist
* @tc.desc Function test
*/
it("contact_delete_test_2800", 0, async function(done) {
@@ -2708,7 +2708,7 @@ describe('ContactsTest', function() {
/**
* @tc.number contact_batchinsert_test_5400
* @tc.name Batch operation of contact blacklist
* @tc.name Batch operation of contact blocklist
* @tc.desc Function test
*/
it("contact_batchinsert_test_5400", 0, async function(done) {
@@ -4729,7 +4729,7 @@ describe('ContactsTest', function() {
/**
* @tc.number contact_insertContactBlocklist_test_6800
* @tc.name Add multiple records to the blacklist and verify whether the insertion is successful
* @tc.name Add multiple records to the blocklist and verify whether the insertion is successful
* @tc.desc Function test
*/
it("contact_insertContactBlocklist_test_6800", 0, async function(done) {
@@ -4776,7 +4776,7 @@ describe('ContactsTest', function() {
/**
* @tc.number contact_removeContactBlocklist_test_6900
* @tc.name Delete multiple records from the blacklist and verify whether the deletion is successful
* @tc.name Delete multiple records from the blocklist and verify whether the deletion is successful
* @tc.desc Function test
*/
it("contact_removeContactBlocklist_test_6900", 0, async function(done) {
@@ -5968,8 +5968,8 @@ describe('ContactsTest', function() {
var dataId1 = await insertData(rawContactId1, "phone", phoneNumber, "");
console.info("logMessage abnormal_contact_insertblocklist_test_9600: dataId1 = " + dataId1);
var blacklist = {"phone_numbers" : phoneNumber};
var code = await DAHelper.insert(contactBlocklistUri, blacklist);
var blocklist = {"phone_numbers" : phoneNumber};
var code = await DAHelper.insert(contactBlocklistUri, blocklist);
expect(code == -1).assertTrue();
await deleteRawContact("abnormal_contact_insertblocklist_test_9600");
await deleteAll(contactDataUri, "abnormal_contact_insertblocklist_test_9600");
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
+11 -11
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 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
@@ -693,17 +693,17 @@ export default {
getPhoneNumberBatch:
function() {
var phoneNumber = randomNum(13);
var contactBlacklistValuesOne = {"phone_number" : phoneNumber};
var contactBlacklistValuesTwo = {"phone_number" : phoneNumber};
var contactBlacklistValuesThree = {"phone_number" : phoneNumber};
var contactBlacklistValuesFour = {"phone_number" : phoneNumber};
var contactBlacklistValuesFive = {"phone_number" : phoneNumber};
var contactBlocklistValuesOne = {"phone_number" : phoneNumber};
var contactBlocklistValuesTwo = {"phone_number" : phoneNumber};
var contactBlocklistValuesThree = {"phone_number" : phoneNumber};
var contactBlocklistValuesFour = {"phone_number" : phoneNumber};
var contactBlocklistValuesFive = {"phone_number" : phoneNumber};
var listAddBluk = []
listAddBluk[0] = contactBlacklistValuesOne;
listAddBluk[1] = contactBlacklistValuesTwo;
listAddBluk[2] = contactBlacklistValuesThree;
listAddBluk[3] = contactBlacklistValuesFour;
listAddBluk[4] = contactBlacklistValuesFive;
listAddBluk[0] = contactBlocklistValuesOne;
listAddBluk[1] = contactBlocklistValuesTwo;
listAddBluk[2] = contactBlocklistValuesThree;
listAddBluk[3] = contactBlocklistValuesFour;
listAddBluk[4] = contactBlocklistValuesFive;
return listAddBluk;
},
getSearchMap:

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