Commit 8ccabb81 authored by vandwalle's avatar vandwalle
Browse files

handle beacons reported with wrong RSSI value of 0

Bug:18654243

Change-Id: Ied2fbc87c7effc23fecb68e9863153d63c0cfba4
parent 93a1fdde
......@@ -171,11 +171,23 @@ public class WifiAutoJoinController {
// Fetch the previous instance for this result
ScanResult sr = scanResultCache.get(result.BSSID);
if (sr != null) {
if (mWifiConfigStore.scanResultRssiLevelPatchUp != 0
&& result.level == 0
&& sr.level < -20) {
// A 'zero' RSSI reading is most likely a chip problem which returns
// an unknown RSSI, hence ignore it
result.level = sr.level;
}
// If there was a previous cache result for this BSSID, average the RSSI values
result.averageRssi(sr.level, sr.seen, mScanResultMaximumAge);
// Remove the previous Scan Result - this is not necessary
scanResultCache.remove(result.BSSID);
} else if (mWifiConfigStore.scanResultRssiLevelPatchUp != 0 && result.level == 0) {
// A 'zero' RSSI reading is most likely a chip problem which returns
// an unknown RSSI, hence initialize it to a sane value
result.level = mWifiConfigStore.scanResultRssiLevelPatchUp;
}
if (!mNetworkScoreCache.isScoredNetwork(result)) {
......
......@@ -387,6 +387,7 @@ public class WifiConfigStore extends IpConfigStore {
public boolean enableWifiCellularHandoverUserTriggeredAdjustment = true;
public int currentNetworkBoost = 25;
public int scanResultRssiLevelPatchUp = -85;
/**
* Regex pattern for extracting a connect choice.
......@@ -539,8 +540,12 @@ public class WifiConfigStore extends IpConfigStore {
enableAutoJoinWhenAssociated = mContext.getResources().getBoolean(
R.bool.config_wifi_framework_enable_associated_network_selection);
currentNetworkBoost = mContext.getResources().getInteger(
R.integer.config_wifi_framework_current_network_boost);
scanResultRssiLevelPatchUp = mContext.getResources().getInteger(
R.integer.config_wifi_framework_scan_result_rssi_level_patchup_value);
}
void enableVerboseLogging(int verbose) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment