change function name

Signed-off-by: fuzikun <fuzikun@huawei.com>
This commit is contained in:
fuzikun
2021-12-20 14:48:37 +08:00
parent 1a3fdc173d
commit 9c751fe3bb
6 changed files with 10 additions and 9 deletions
+4 -3
View File
@@ -1194,7 +1194,8 @@ bool IsSameNameGroupExist(const char *ownerName, const char *groupName)
TrustedGroupEntry **entry = NULL;
g_databaseMutex->lock(g_databaseMutex);
FOR_EACH_HC_VECTOR(g_trustedGroupTable, index, entry) {
if (strcmp(StringGet(&(*entry)->name), groupName) != 0) {
if ((entry == NULL) || (*entry == NULL) ||
(strcmp(StringGet(&(*entry)->name), groupName) != 0)) {
continue;
}
if (HC_VECTOR_SIZE(&(*entry)->managers) > 0) {
@@ -1216,7 +1217,7 @@ bool IsIdenticalGroupExist(void)
TrustedGroupEntry **entry = NULL;
g_databaseMutex->lock(g_databaseMutex);
FOR_EACH_HC_VECTOR(g_trustedGroupTable, index, entry) {
if ((*entry)->type == IDENTICAL_ACCOUNT_GROUP) {
if ((entry != NULL) && (*entry != NULL) && ((*entry)->type == IDENTICAL_ACCOUNT_GROUP)) {
g_databaseMutex->unlock(g_databaseMutex);
return true;
}
@@ -1231,7 +1232,7 @@ bool IsAcrossAccountGroupExist(void)
TrustedGroupEntry **entry = NULL;
g_databaseMutex->lock(g_databaseMutex);
FOR_EACH_HC_VECTOR(g_trustedGroupTable, index, entry) {
if ((*entry)->type == ACROSS_ACCOUNT_AUTHORIZE_GROUP) {
if ((entry != NULL) && (*entry != NULL) && ((*entry)->type == ACROSS_ACCOUNT_AUTHORIZE_GROUP)) {
g_databaseMutex->unlock(g_databaseMutex);
return true;
}
@@ -33,7 +33,7 @@ int32_t OpenChannel(ChannelType channelType, const CJson *jsonParams, int64_t re
void CloseChannel(ChannelType channelType, int64_t channelId);
int32_t HcSendMsg(ChannelType channelType, int64_t requestId, int64_t channelId,
const DeviceAuthCallback *callback, const char *data);
void SetAuthResult(ChannelType channelType, int64_t channelId);
void NotifyBindResult(ChannelType channelType, int64_t channelId);
int32_t GetLocalConnectInfo(char *jsonAddrInfo, int32_t bufLen);
#ifdef __cplusplus
@@ -102,7 +102,7 @@ int32_t HcSendMsg(ChannelType channelType, int64_t requestId, int64_t channelId,
}
}
void SetAuthResult(ChannelType channelType, int64_t channelId)
void NotifyBindResult(ChannelType channelType, int64_t channelId)
{
if (channelType == SOFT_BUS) {
GetSoftBusInstance()->notifyResult(channelId);
@@ -340,7 +340,7 @@ static int32_t CheckInputGroupTypeValid(const CJson *jsonParams)
return AssertPeerToPeerGroupType(groupType);
}
static int32_t IsPeerDeviceIdNotSelf(const char *peerUdid)
static int32_t IsPeerDeviceNotSelf(const char *peerUdid)
{
if (peerUdid == NULL) {
LOGE("The input peerUdid is NULL!");
@@ -376,7 +376,7 @@ static int32_t CheckPeerDeviceStatus(const char *groupId, const CJson *jsonParam
DestroyDeviceInfoStruct(deviceInfo);
return result;
}
result = IsPeerDeviceIdNotSelf(StringGet(&deviceInfo->udid));
result = IsPeerDeviceNotSelf(StringGet(&deviceInfo->udid));
DestroyDeviceInfoStruct(deviceInfo);
return result;
}
@@ -1033,7 +1033,7 @@ static int32_t OnSessionFinish(const BindSession *session, CJson *jsonParams, CJ
return result;
}
LOGI("The session completed successfully! [ReqId]: %" PRId64, session->reqId);
SetAuthResult(session->channelType, session->channelId);
NotifyBindResult(session->channelType, session->channelId);
CloseChannel(session->channelType, session->channelId);
return HC_SUCCESS;
}
@@ -62,7 +62,7 @@ static int32_t OnSessionFinish(const BindSession *session, CJson *out)
ProcessFinishCallback(session->reqId, session->opCode, returnDataStr, session->base.callback);
FreeJsonString(returnDataStr);
LOGI("The session completed successfully! [ReqId]: %" PRId64, session->reqId);
SetAuthResult(session->channelType, session->channelId);
NotifyBindResult(session->channelType, session->channelId);
CloseChannel(session->channelType, session->channelId);
return HC_SUCCESS;
}