!109 changechange GetDeviceInfoById function name

Merge pull request !109 from 符子坤/master
This commit is contained in:
openharmony_ci
2021-11-09 06:07:18 +00:00
committed by Gitee
7 changed files with 13 additions and 13 deletions
@@ -62,7 +62,7 @@ void DeregGenerateGroupIdFunc(void);
int32_t GetTrustedDevNumber(void);
int32_t GetGroupInfoById(const char *groupId, GroupInfo *returnGroupInfo);
int32_t GetGroupInfoIfDevExist(const char *groupId, const char *udid, GroupInfo *returnGroupInfo);
int32_t GetDeviceInfoById(const char *deviceId, bool isUdid, const char *groupId, DeviceInfo *deviceInfo);
int32_t GetTrustedDevInfoById(const char *deviceId, bool isUdid, const char *groupId, DeviceInfo *deviceInfo);
int32_t GetJoinedGroupInfoVecByDevId(const GroupQueryParams *params, GroupInfoVec *vec);
int32_t GetGroupNumByOwner(const char *ownerName);
int32_t GetCurDeviceNumByGroupId(const char *groupId);
@@ -1251,7 +1251,7 @@ bool IsGroupExistByGroupId(const char *groupId)
return isExists;
}
int32_t GetDeviceInfoById(const char *deviceId, bool isUdid, const char *groupId, DeviceInfo *deviceInfo)
int32_t GetTrustedDevInfoById(const char *deviceId, bool isUdid, const char *groupId, DeviceInfo *deviceInfo)
{
if ((deviceId == NULL) || (groupId == NULL) || (deviceInfo == NULL)) {
LOGE("[DB]: The input parameters contains NULL value!");
@@ -339,9 +339,9 @@ static int32_t FillNonAccountAuthInfo(const GroupInfo *entry, const DeviceInfo *
const char *peerUdid = GetStringFromJson(paramsData, FIELD_PEER_CONN_DEVICE_ID);
const char *peeAuthId = GetStringFromJson(paramsData, FIELD_PEER_AUTH_ID);
if (peerUdid != NULL) {
res = GetDeviceInfoById(peerUdid, true, groupId, peerAuthInfo);
res = GetTrustedDevInfoById(peerUdid, true, groupId, peerAuthInfo);
} else if (peeAuthId != NULL) {
res = GetDeviceInfoById(peeAuthId, false, groupId, peerAuthInfo);
res = GetTrustedDevInfoById(peeAuthId, false, groupId, peerAuthInfo);
} else {
LOGE("Invalid input, both peer udid and peer authId are null!");
res = HC_ERR_NULL_PTR;
@@ -242,7 +242,7 @@ static int32_t GeneratePkInfo(const char *queryUdid, const char *groupId, CJson
LOGE("Failed to allocate deviceInfo memory!");
return HC_ERR_ALLOC_MEMORY;
}
int32_t res = GetDeviceInfoById(queryUdid, true, groupId, deviceInfo);
int32_t res = GetTrustedDevInfoById(queryUdid, true, groupId, deviceInfo);
if (res != HC_SUCCESS) {
DestroyDeviceInfoStruct(deviceInfo);
return res;
@@ -1019,7 +1019,7 @@ static int32_t GetAccessibleDeviceInfoById(const char *appId, const char *device
LOGE("Failed to allocate devInfo memory!");
return HC_ERR_ALLOC_MEMORY;
}
if (GetDeviceInfoById(deviceId, isUdid, groupId, devInfo) != HC_SUCCESS) {
if (GetTrustedDevInfoById(deviceId, isUdid, groupId, devInfo) != HC_SUCCESS) {
LOGE("No device is found based on the query parameters!");
DestroyDeviceInfoStruct(devInfo);
return HC_ERR_DEVICE_NOT_EXIST;
@@ -168,7 +168,7 @@ static int32_t GetPeerUserType(const char *groupId, const char *peerAuthId)
LOGE("Failed to allocate devEntry memory!");
return peerUserType;
}
if (GetDeviceInfoById(peerAuthId, false, groupId, devAuthParams) != HC_SUCCESS) {
if (GetTrustedDevInfoById(peerAuthId, false, groupId, devAuthParams) != HC_SUCCESS) {
LOGE("Failed to obtain the device information from the database!");
DestroyDeviceInfoStruct(devAuthParams);
return peerUserType;
@@ -227,7 +227,7 @@ static int32_t AddAuthIdAndUserTypeToParams(const char *groupId, CJson *jsonPara
DestroyDeviceInfoStruct(deviceInfo);
return HC_ERROR;
}
if (GetDeviceInfoById(udid, true, groupId, deviceInfo) != HC_SUCCESS) {
if (GetTrustedDevInfoById(udid, true, groupId, deviceInfo) != HC_SUCCESS) {
LOGE("Failed to obtain the device information from the database!");
DestroyDeviceInfoStruct(deviceInfo);
return HC_ERR_DB;
@@ -295,7 +295,7 @@ static int32_t CheckPeerDeviceStatus(const char *groupId, const CJson *jsonParam
LOGE("Failed to allocate deviceInfo memory!");
return HC_ERR_ALLOC_MEMORY;
}
int32_t result = GetDeviceInfoById(peerAuthId, false, groupId, deviceInfo);
int32_t result = GetTrustedDevInfoById(peerAuthId, false, groupId, deviceInfo);
if (result != HC_SUCCESS) {
LOGE("Failed to obtain the peer device information from the database!");
DestroyDeviceInfoStruct(deviceInfo);
@@ -149,7 +149,7 @@ static int32_t GetLocalDeviceInfoFromDatabase(const char *groupId, DeviceInfo *l
LOGE("Failed to get local udid!");
return HC_ERR_DB;
}
res = GetDeviceInfoById(localUdidStr, true, groupId, localAuthInfo);
res = GetTrustedDevInfoById(localUdidStr, true, groupId, localAuthInfo);
if (res != HC_SUCCESS) {
LOGE("Failed to get local device info from database!");
}
@@ -343,7 +343,7 @@ static int32_t AddDevInfoByDatabase(const char *groupId, CJson *params)
LOGE("Failed to allocate devEntry memory!");
return HC_ERR_ALLOC_MEMORY;
}
if (GetDeviceInfoById(udid, true, groupId, devAuthParams) != HC_SUCCESS) {
if (GetTrustedDevInfoById(udid, true, groupId, devAuthParams) != HC_SUCCESS) {
LOGE("Failed to obtain the device information from the database!");
DestroyDeviceInfoStruct(devAuthParams);
return HC_ERR_DB;
@@ -453,7 +453,7 @@ static int32_t CheckAuthIdAndUserTypeValid(int userType, const char *groupId, co
LOGE("Failed to allocate deviceInfo memory!");
return HC_ERR_ALLOC_MEMORY;
}
int32_t result = GetDeviceInfoById(udid, true, groupId, deviceInfo);
int32_t result = GetTrustedDevInfoById(udid, true, groupId, deviceInfo);
if (result != HC_SUCCESS) {
LOGE("Failed to obtain the local device information from the database!");
DestroyDeviceInfoStruct(deviceInfo);
@@ -668,7 +668,7 @@ static int32_t AddPeerUserTypeIfDelete(BindSession *session)
LOGE("Failed to allocate devEntry memory!");
return HC_ERR_ALLOC_MEMORY;
}
if (GetDeviceInfoById(peerAuthId, false, groupId, devAuthParams) != HC_SUCCESS) {
if (GetTrustedDevInfoById(peerAuthId, false, groupId, devAuthParams) != HC_SUCCESS) {
LOGE("Failed to obtain the device information from the database!");
DestroyDeviceInfoStruct(devAuthParams);
return HC_ERR_DB;