!1505 以静态IP连接的热点,切换连接时设置列表和状态栏wifi图标有1秒左右置灰显示

Merge pull request !1505 from liuyuanyuan66/master
This commit is contained in:
openharmony_ci 2023-11-28 12:19:53 +00:00 committed by Gitee
commit fc7c971818
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 22 additions and 22 deletions

View File

@ -844,6 +844,11 @@ void StaStateMachine::DealSignalPollResult(InternalMessage *msg)
MacAnonymize(linkedInfo.bssid).c_str(), signalInfo.frequency, signalInfo.signal, signalInfo.noise,
signalInfo.chload, signalInfo.snr, signalInfo.ulDelay, signalInfo.txrate, signalInfo.rxrate, signalInfo.txBytes,
signalInfo.rxBytes, signalInfo.txFailed, signalInfo.txPackets, signalInfo.rxPackets);
if (signalInfo.frequency > 0) {
linkedInfo.frequency = signalInfo.frequency;
}
ConvertFreqToChannel();
if (signalInfo.signal > INVALID_RSSI_VALUE && signalInfo.signal < MAX_RSSI_VALUE) {
if (signalInfo.signal > 0) {
linkedInfo.rssi = setRssi((signalInfo.signal - SIGNAL_INFO));
@ -886,9 +891,6 @@ void StaStateMachine::DealSignalPollResult(InternalMessage *msg)
InvokeOnStaStreamChanged(StreamDirection::STREAM_DIRECTION_DOWN);
}
if (signalInfo.frequency > 0) {
linkedInfo.frequency = signalInfo.frequency;
}
linkedInfo.snr = signalInfo.snr;
if (linkedInfo.wifiStandard == WIFI_MODE_UNDEFINED) {
WifiSettings::GetInstance().SetWifiLinkedStandardAndMaxSpeed(linkedInfo);
@ -897,7 +899,6 @@ void StaStateMachine::DealSignalPollResult(InternalMessage *msg)
linkedInfo.wifiStandard, MacAnonymize(linkedInfo.bssid).c_str(), linkedInfo.maxSupportedRxLinkSpeed,
linkedInfo.maxSupportedTxLinkSpeed);
WifiSettings::GetInstance().SaveLinkedInfo(linkedInfo, m_instId);
ConvertFreqToChannel();
DealSignalPacketChanged(signalInfo.txPackets, signalInfo.rxPackets);
StartTimer(static_cast<int>(CMD_SIGNAL_POLL), STA_SIGNAL_POLL_DELAY);
}

View File

@ -1389,24 +1389,6 @@ int WifiSettings::GetSignalLevel(const int &rssi, const int &band, int instId)
auto iter = mWifiConfig.find(instId);
if (iter != mWifiConfig.end()) {
do {
if (band == static_cast<int>(BandType::BAND_2GHZ)) {
if (rssi < iter->second.firstRssiLevel2G) {
break;
}
++level;
if (rssi < iter->second.secondRssiLevel2G) {
break;
}
++level;
if (rssi < iter->second.thirdRssiLevel2G) {
break;
}
++level;
if (rssi < iter->second.fourthRssiLevel2G) {
break;
}
++level;
}
if (band == static_cast<int>(BandType::BAND_5GHZ)) {
if (rssi < iter->second.firstRssiLevel5G) {
break;
@ -1424,6 +1406,23 @@ int WifiSettings::GetSignalLevel(const int &rssi, const int &band, int instId)
break;
}
++level;
} else {
if (rssi < iter->second.firstRssiLevel2G) {
break;
}
++level;
if (rssi < iter->second.secondRssiLevel2G) {
break;
}
++level;
if (rssi < iter->second.thirdRssiLevel2G) {
break;
}
++level;
if (rssi < iter->second.fourthRssiLevel2G) {
break;
}
++level;
}
} while (0);
}