!5940 bix:Delete peer-to-peer groups without setiing default account

Merge pull request !5940 from 樊东海/master
This commit is contained in:
openharmony_ci 2024-05-04 13:37:06 +00:00 committed by Gitee
commit 1d752e5175
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
8 changed files with 18 additions and 14 deletions

View File

@ -32,7 +32,7 @@ extern "C" {
typedef struct {
void (*onGroupCreated)(const char *groupId, int32_t groupType);
void (*onGroupDeleted)(const char *groupId);
void (*onGroupDeleted)(const char *groupId, int32_t groupType);
void (*onDeviceNotTrusted)(const char *udid);
void (*onDeviceBound)(const char *udid, const char *groupInfo);
} TrustDataChangeListener;

View File

@ -120,7 +120,7 @@ void AuthServerDeathCallback(const char *pkgName, int32_t pid);
typedef struct {
void (*onGroupCreated)(const char *groupId, int32_t groupType);
void (*onGroupDeleted)(const char *groupId);
void (*onGroupDeleted)(const char *groupId, int32_t groupType);
void (*onDeviceBound)(const char *udid, const char *groupInfo);
} GroupChangeListener;
@ -205,4 +205,4 @@ int32_t AuthRestoreAuthManager(const char *udidHash,
}
#endif
#endif
#endif /* AUTH_INTERFACE_H */
#endif /* AUTH_INTERFACE_H */

View File

@ -282,7 +282,7 @@ static void OnGroupDeleted(const char *groupInfo)
}
AUTH_LOGI(AUTH_HICHAIN, "hichain OnGroupDeleted, type=%{public}d", info.groupType);
if (g_dataChangeListener.onGroupDeleted != NULL) {
g_dataChangeListener.onGroupDeleted(info.groupId);
g_dataChangeListener.onGroupDeleted(info.groupId, info.groupType);
}
}
@ -375,4 +375,4 @@ void HichainDestroy(void)
void HichainCancelRequest(int64_t authReqId)
{
CancelRequest(authReqId, AUTH_APPID);
}
}

View File

@ -800,10 +800,10 @@ static void OnGroupCreated(const char *groupId, int32_t groupType)
}
}
static void OnGroupDeleted(const char *groupId)
static void OnGroupDeleted(const char *groupId, int32_t groupType)
{
if (g_groupChangeListener.onGroupDeleted != NULL) {
g_groupChangeListener.onGroupDeleted(groupId);
g_groupChangeListener.onGroupDeleted(groupId, groupType);
}
}
@ -2826,4 +2826,4 @@ int32_t AuthAllocLane(const char *networkId, uint32_t authRequestId, AuthConnCal
return SOFTBUS_ERR;
}
return SOFTBUS_OK;
}
}

View File

@ -434,11 +434,13 @@ static void OnGroupCreated(const char *groupId, int32_t groupType)
EhLoginEventHandler();
}
static void OnGroupDeleted(const char *groupId)
static void OnGroupDeleted(const char *groupId, int32_t groupType)
{
(void)groupId;
LNN_LOGD(LNN_BUILDER, "wifi handle OnGroupDeleted");
LnnOnOhosAccountLogout();
if (groupType == AUTH_IDENTICAL_ACCOUNT_GROUP) {
LnnOnOhosAccountLogout();
}
LnnHbOnTrustedRelationReduced();
}

View File

@ -65,9 +65,10 @@ void OnGroupCreatedTest(const char *groupId, int32_t groupType)
(void)groupType;
}
void OnGroupDeletedTest(const char *groupId)
void OnGroupDeletedTest(const char *groupId, int32_t groupType)
{
(void)groupId;
(void)groupType;
}
/*
* @tc.name: ON_DEVICE_NOT_TRUSTED_TEST_001

View File

@ -303,7 +303,7 @@ HWTEST_F(AuthManagerTest, RETRY_REG_TRUST_DATA_CHANGE_LISTENER_TEST_001, TestSiz
NotifyDeviceDisconnect(authHandle);
OnDeviceNotTrusted(UDID_TEST);
OnGroupCreated("myId", GROUP_TYPE);
OnGroupDeleted("myId");
OnGroupDeleted("myId", GROUP_TYPE);
OnDeviceBound(UDID_TEST, "groupInfo");
EXPECT_TRUE(RetryRegTrustDataChangeListener() == SOFTBUS_ERR);
RemoveNotPassedAuthManagerByUdid(PEER_UID);

View File

@ -83,9 +83,10 @@ static void OnGroupCreated(const char *groupId, int32_t groupType)
return;
}
static void OnGroupDeleted(const char *groupId)
static void OnGroupDeleted(const char *groupId, int32_t groupType)
{
(void)groupId;
(void)groupType;
return;
}
@ -2140,4 +2141,4 @@ HWTEST_F(AuthTest, GET_TCP_KEEPALIVE_OPTION_BY_CYCLE_Test_001, TestSize.Level1)
ret = GetTcpKeepAliveOptionByCycle(DEFT_FREQ_CYCLE, &keepAliveIntvl, &keepAliveCount, &userTimeOut);
EXPECT_TRUE(ret == SOFTBUS_OK);
}
} // namespace OHOS
} // namespace OHOS