!7788 修复快速切换亮灭屏,亮屏广播偶现发送失败的bug

Merge pull request !7788 from wudj2110/master_screen_status_merge
This commit is contained in:
openharmony_ci 2024-09-19 09:11:19 +00:00 committed by Gitee
commit ed64f260cf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 5 deletions

View File

@ -562,6 +562,7 @@ static void HbScreenStateChangeEventHandler(const LnnEventBasicInfo *info)
nowTime = time.sec * HB_TIME_FACTOR + time.usec / HB_TIME_FACTOR;
HbScreenOnOnceTryCloudSync();
if (g_hbConditionState.screenState == SOFTBUS_SCREEN_ON && oldstate != SOFTBUS_SCREEN_ON) {
(void)LnnUpdateLocalScreenStatus(true);
HbScreenOnChangeEventHandler(nowTime);
return;
}
@ -569,10 +570,11 @@ static void HbScreenStateChangeEventHandler(const LnnEventBasicInfo *info)
LNN_LOGI(LNN_HEART_BEAT, "HB handle SOFTBUS_SCREEN_OFF");
g_lastScreenOffTime = nowTime;
(void)LnnUpdateLocalScreenStatus(false);
if (LnnStartHbByTypeAndStrategy(
HEARTBEAT_TYPE_BLE_V0 | HEARTBEAT_TYPE_BLE_V3, STRATEGY_HB_SEND_SINGLE, false) != SOFTBUS_OK) {
LNN_LOGE(LNN_HEART_BEAT, "start ble heartbeat failed");
return;
if (!LnnIsLocalSupportBurstFeature()) {
if (LnnStartHbByTypeAndStrategy(HEARTBEAT_TYPE_BLE_V0, STRATEGY_HB_SEND_SINGLE, false) != SOFTBUS_OK) {
LNN_LOGE(LNN_HEART_BEAT, "start ble heartbeat failed");
return;
}
}
if (LnnStopHeartBeatAdvByTypeNow(HEARTBEAT_TYPE_BLE_V1) != SOFTBUS_OK) {
LNN_LOGE(LNN_HEART_BEAT, "ctrl disable ble heartbeat failed");

View File

@ -381,7 +381,7 @@ void LnnRemoveSendEndMsg(LnnHeartbeatFsm *hbFsm, LnnHeartbeatType type, bool wak
*isRemoved = true;
LnnRemoveSendEndMsgPara msgPara = {
.hbType = type,
.hbType = type & (~HEARTBEAT_TYPE_BLE_V3),
.wakeupFlag = wakeupFlag,
.isRelay = isRelay,
.isRemoved = isRemoved,