diff --git a/services/common/inc/data_base/database_manager.h b/services/common/inc/data_base/database_manager.h index e74e455..840cc85 100644 --- a/services/common/inc/data_base/database_manager.h +++ b/services/common/inc/data_base/database_manager.h @@ -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); diff --git a/services/common/src/data_base/database_manager.c b/services/common/src/data_base/database_manager.c index 694b018..411636e 100644 --- a/services/common/src/data_base/database_manager.c +++ b/services/common/src/data_base/database_manager.c @@ -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!"); diff --git a/services/group_auth/src/group_auth_manager/account_unrelated_group_auth/account_unrelated_group_auth.c b/services/group_auth/src/group_auth_manager/account_unrelated_group_auth/account_unrelated_group_auth.c index aae7b5c..6cb1aa8 100644 --- a/services/group_auth/src/group_auth_manager/account_unrelated_group_auth/account_unrelated_group_auth.c +++ b/services/group_auth/src/group_auth_manager/account_unrelated_group_auth/account_unrelated_group_auth.c @@ -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; diff --git a/services/group_manager/src/group_operation/group_operation.c b/services/group_manager/src/group_operation/group_operation.c index 113c99b..04f9ac5 100644 --- a/services/group_manager/src/group_operation/group_operation.c +++ b/services/group_manager/src/group_operation/group_operation.c @@ -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; diff --git a/services/group_manager/src/group_operation/peer_to_peer_group/peer_to_peer_group.c b/services/group_manager/src/group_operation/peer_to_peer_group/peer_to_peer_group.c index 374d355..2550d28 100644 --- a/services/group_manager/src/group_operation/peer_to_peer_group/peer_to_peer_group.c +++ b/services/group_manager/src/group_operation/peer_to_peer_group/peer_to_peer_group.c @@ -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); diff --git a/services/session/src/auth_session/auth_session_common.c b/services/session/src/auth_session/auth_session_common.c index 9d320d5..f5641cc 100644 --- a/services/session/src/auth_session/auth_session_common.c +++ b/services/session/src/auth_session/auth_session_common.c @@ -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!"); } diff --git a/services/session/src/bind_session/bind_session_common.c b/services/session/src/bind_session/bind_session_common.c index 492d760..ecd8b68 100644 --- a/services/session/src/bind_session/bind_session_common.c +++ b/services/session/src/bind_session/bind_session_common.c @@ -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;