diff options
author | Stefan Assmann <sassmann@kpanic.de> | 2019-03-11 17:09:49 +0100 |
---|---|---|
committer | Francescodario Cuzzocrea <bosconovic@gmail.com> | 2020-12-12 10:19:10 +0100 |
commit | e6611b384f35aafd787c471ae048cc2ce5ac4999 (patch) | |
tree | a5c0f6cf41afcc0dd1014b70b07fd5c6e4f1e60d /service | |
parent | cf6fa566890631e19d18c4ce07393f5c6de6cb2d (diff) |
resurrect mWifiLinkLayerStatsSupported counter
On devices with broken/not implemented LinkLayerStats
the counter mWifiLinkLayerStatsSupported prevents the following error
messages from appearing every 3 seconds.
03-08 10:43:02.616 389 389 E WifiHAL : wifi_get_link_stats: requestResponse Error:-3
03-08 10:43:02.617 2030 2206 E WifiVendorHal: getWifiLinkLayerStats(l.937) failed {.code = ERROR_NOT_SUPPORTED, .description = }
This partially reverts commit 1ba5b5858ffc04acbd317dc1f6789f1777d375e6.
Change-Id: I840f9d1304bf0a31e7a6b65db00a37dc3651e4b8
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 3a24f3580..d6645dfd8 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -355,6 +355,8 @@ public class ClientModeImpl extends StateMachine { private DetailedState mNetworkAgentState; private SupplicantStateTracker mSupplicantStateTracker; + private int mWifiLinkLayerStatsSupported = 4; // Temporary disable + // Indicates that framework is attempting to roam, set true on CMD_START_ROAM, set false when // wifi connects or fails to connect private boolean mIsAutoRoaming = false; @@ -1304,15 +1306,20 @@ public class ClientModeImpl extends StateMachine { loge("getWifiLinkLayerStats called without an interface"); return null; } + WifiLinkLayerStats stats = null; mLastLinkLayerStatsUpdate = mClock.getWallClockMillis(); - WifiLinkLayerStats stats = mWifiNative.getWifiLinkLayerStats(mInterfaceName); - if (stats != null) { - mOnTime = stats.on_time; - mTxTime = stats.tx_time; - mRxTime = stats.rx_time; - mRunningBeaconCount = stats.beacon_rx; - mWifiInfo.updatePacketRates(stats, mLastLinkLayerStatsUpdate); - } else { + if (mWifiLinkLayerStatsSupported > 0) { + stats = mWifiNative.getWifiLinkLayerStats(mInterfaceName); + if (stats == null) { + mWifiLinkLayerStatsSupported -= 1; + } else { + mOnTime = stats.on_time; + mTxTime = stats.tx_time; + mRxTime = stats.rx_time; + mRunningBeaconCount = stats.beacon_rx; + mWifiInfo.updatePacketRates(stats, mLastLinkLayerStatsUpdate); + } + } else { // LinkLayerStats are broken or unsupported long mTxPkts = mFacade.getTxPackets(mInterfaceName); long mRxPkts = mFacade.getRxPackets(mInterfaceName); mWifiInfo.updatePacketRates(mTxPkts, mRxPkts, mLastLinkLayerStatsUpdate); |