!3360 限制自愈次数

Merge pull request !3360 from yiyajun/master
This commit is contained in:
openharmony_ci 2024-11-22 03:12:00 +00:00 committed by Gitee
commit bfc7c9befd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 3 deletions

View File

@ -529,11 +529,11 @@ void SelfCureStateMachine::ConnectedMonitorState::HandleDnsFailedMonitor(Interna
void SelfCureStateMachine::ConnectedMonitorState::HandleInternetFailedDetected(InternalMessagePtr msg)
{
WIFI_LOGD("HandleInternetFailedDetected, wifi has no internet when connected.");
if (pSelfCureStateMachine->IsCustNetworkSelfCure()) {
WIFI_LOGI("current network do not need selfcure");
if (pSelfCureStateMachine->IsCustNetworkSelfCure() || pSelfCureStateMachine->isInternetFailureDetected_) {
WIFI_LOGI("do not need selfcure, %{public}d", pSelfCureStateMachine->isInternetFailureDetected_);
return;
}
pSelfCureStateMachine->isInternetFailureDetected_ = true;
if (!pSelfCureStateMachine->IsSuppOnCompletedState()) {
WIFI_LOGI("%{public}s: Wifi connection not completed", __FUNCTION__);
return;
@ -630,6 +630,7 @@ void SelfCureStateMachine::DisconnectedMonitorState::GoInState()
pSelfCureStateMachine->noAutoConnCounter = 0;
pSelfCureStateMachine->noAutoConnReason = -1;
pSelfCureStateMachine->connectedTime = 0;
pSelfCureStateMachine->isInternetFailureDetected_ = false;
pSelfCureStateMachine->ClearDhcpOffer();
return;
}
@ -964,6 +965,7 @@ void SelfCureStateMachine::InternetSelfCureState::HandleInternetRecoveryConfirm(
pSelfCureStateMachine->UpdateSelfCureConnectHistoryInfo(selfCureHistoryInfo, currentSelfCureLevel, true);
bool success = ConfirmInternetSelfCure(currentSelfCureLevel);
if (success) {
pSelfCureStateMachine->isInternetFailureDetected_ = false;
currentSelfCureLevel = WIFI_CURE_RESET_LEVEL_IDLE;
selfCureFailedCounter = 0;
hasInternetRecently = true;
@ -3535,6 +3537,7 @@ void SelfCureStateMachine::ResetSelfCureParam()
{
selfCureNetworkLastState_ = DetailedState::IDLE;
selfCureWifiLastState_ = WifiState::UNKNOWN;
selfCureState_ = SelfCureState::SCE_WIFI_INVALID_STATE;
connectNetworkRetryCnt = 0;
WifiConfigCenter::GetInstance().SetWifiSelfcureReset(false);
StopTimer(WIFI_CURE_RESET_OFF_TIMEOUT);

View File

@ -474,6 +474,7 @@ private:
sptr<NetStateObserver> mNetWorkDetect;
bool m_httpDetectResponse = false;
bool p2pEnhanceConnected_ = false;
bool isInternetFailureDetected_ = false;
DetailedState selfCureNetworkLastState_ = DetailedState::IDLE;
WifiState selfCureWifiLastState_ = WifiState::UNKNOWN;
SelfCureState selfCureState_ = SelfCureState::SCE_WIFI_INVALID_STATE;