!8415 fix:Alarm modification

Merge pull request !8415 from 冯叶叶/master
This commit is contained in:
openharmony_ci 2024-11-22 11:38:41 +00:00 committed by Gitee
commit 181d555c08
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 11 additions and 9 deletions

View File

@ -355,13 +355,6 @@ static void BleNotifyDeviceConnectResult(const ConnBleDevice *device, ConnBleCon
}
return;
}
UpdateOption option = {
.type = CONNECT_BLE,
.bleOption = {
.priority = CONN_BLE_PRIORITY_BALANCED,
}
};
BleUpdateConnection(connection->connectionId, &option);
ConnectionInfo info = { 0 };
int32_t status = BleConvert2ConnectionInfo(connection, &info);
@ -686,6 +679,13 @@ static void BleClientConnected(uint32_t connectionId)
return;
}
ConnRemoveMsgFromLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_CONNECT_TIMEOUT, connectionId, 0, NULL);
UpdateOption option = {
.type = CONNECT_BLE,
.bleOption = {
.priority = CONN_BLE_PRIORITY_BALANCED,
}
};
BleUpdateConnection(connectionId, &option);
CONN_LOGI(
CONN_BLE, "ble client connect success, clientId=%{public}d, addr=%{public}s", connectionId, anomizeAddress);
connection->underlayerFastConnectFailedScanFailure = false;
@ -1594,6 +1594,7 @@ static void DataReceivedFunc(SoftBusMessage *msg)
{
CONN_CHECK_AND_RETURN_LOGW(msg->obj != NULL, CONN_BLE, "obj is null");
ConnBleDataReceivedContext *ctx = (ConnBleDataReceivedContext *)msg->obj;
CONN_CHECK_AND_RETURN_LOGW(ctx->data != NULL, CONN_BLE, "data is null");
if (g_bleManager.state->dataReceived == NULL) {
SoftBusFree(ctx->data);
return;

View File

@ -1141,6 +1141,7 @@ static void DataReceivedFunc(SoftBusMessage *msg)
{
CONN_CHECK_AND_RETURN_LOGW(msg->obj != NULL, CONN_BR, "obj is null");
ConnBrDataReceivedContext *ctx = (ConnBrDataReceivedContext *)msg->obj;
CONN_CHECK_AND_RETURN_LOGW(ctx->data != NULL, CONN_BR, "data is null");
if (g_brManager.state->dataReceived == NULL) {
SoftBusFree(ctx->data);
return;

View File

@ -374,9 +374,9 @@ HWTEST_F(ConnectionBrConnectionTest, BrManagerTest008, TestSize.Level1)
LocalListenerInfo *info = (LocalListenerInfo *)SoftBusCalloc(sizeof(LocalListenerInfo));
ASSERT_NE(nullptr, info);
info->type = CONNECT_BR;
EXPECT_CALL(brMock, SoftBusThreadCreate).WillOnce(Return(SOFTBUS_ERR));
EXPECT_CALL(brMock, SoftBusThreadCreate).WillOnce(Return(SOFTBUS_INVALID_PARAM));
int32_t ret = g_connectFuncInterface->StartLocalListening(info);
EXPECT_EQ(SOFTBUS_ERR, ret);
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
EXPECT_CALL(brMock, SoftBusThreadCreate).WillOnce(Return(SOFTBUS_OK));
ret = g_connectFuncInterface->StartLocalListening(info);