summaryrefslogtreecommitdiffstats
path: root/service/java/com
diff options
context:
space:
mode:
authorPrem Kumar <premk@google.com>2014-12-14 19:52:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-14 19:52:21 +0000
commite97752385ec67e72f8ae7a772eb7af3014266ace (patch)
tree72f55c4221d99c12b9387453fa387251b83ca8aa /service/java/com
parentca98d25affbc5bc948bf1f9a597a346cf347f27a (diff)
parent8ccabb81ad304b80dc8eaa162fd322643461529b (diff)
downloadandroid_frameworks_opt_net_wifi-e97752385ec67e72f8ae7a772eb7af3014266ace.tar.gz
android_frameworks_opt_net_wifi-e97752385ec67e72f8ae7a772eb7af3014266ace.tar.bz2
android_frameworks_opt_net_wifi-e97752385ec67e72f8ae7a772eb7af3014266ace.zip
Merge "handle beacons reported with wrong RSSI value of 0 Bug:18654243" into lmp-mr1-dev
Diffstat (limited to 'service/java/com')
-rw-r--r--service/java/com/android/server/wifi/WifiAutoJoinController.java12
-rw-r--r--service/java/com/android/server/wifi/WifiConfigStore.java5
2 files changed, 17 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiAutoJoinController.java b/service/java/com/android/server/wifi/WifiAutoJoinController.java
index 0dfa3fb7b..596a61d92 100644
--- a/service/java/com/android/server/wifi/WifiAutoJoinController.java
+++ b/service/java/com/android/server/wifi/WifiAutoJoinController.java
@@ -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)) {
diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java
index 028e2bb42..cf4163557 100644
--- a/service/java/com/android/server/wifi/WifiConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiConfigStore.java
@@ -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) {