Bug fix of BW Estimation
Fix ArrayIndexOutOfBoundsException due to the illegal value of
mSignalLevel and mBandIdx. Normally getLinkBandwidth() is called after
updateLinkBandwidth() so that mSignalLevel and mBandIdx are set
correctly. However, getLinkBandwidth() could be called without
updateLinkBandwidth(). This happens inside WifiScoreReport when
notifyScoreUpdate() is called for the 1st time after SSID level
connection. The exact returned value doesn't matter here because the
value only goes to bugreport dump() and it is just the first value could
be wrong.
This bug so far happens in R + latest mainline module in ACTS tests and
not in S ACTS tests. It doesn't happen so far in manual tests.
However,it in theory could happen in S when the network is temporarily
removed and then quickly added back and reconnects while the external
scorer hasn't got disconnection notification and continues to send
score update back while 1st RSSI poll after re-connection hasn't
happened or completed yet. This is what happened in the failed ACTS test
case.
The simple fix is to change mSignalLEvel and mBandIdx initial value to 0. This should not affect normal report path which goes to NetworkCapabilities.
Bug: 180569002
Test: atest com.android.server.wifi
Change-Id: I75868274db74463bb382887effa393be450a6337
2 files changed