summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArif Hussain <arifhussain@codeaurora.org>2014-08-14 18:53:02 -0700
committerLinux Build Service Account <lnxbuild@localhost>2014-11-04 08:23:01 -0700
commit9c5eeac30a1091bd4906a341ebcb83c5c5561d96 (patch)
tree479bdb2e7cf008b13093fc099628668a21e62415
parent540abbb4adb1f90581004f64b24865a0f6221045 (diff)
downloadandroid_frameworks_opt_net_wifi-9c5eeac30a1091bd4906a341ebcb83c5c5561d96.tar.gz
android_frameworks_opt_net_wifi-9c5eeac30a1091bd4906a341ebcb83c5c5561d96.tar.bz2
android_frameworks_opt_net_wifi-9c5eeac30a1091bd4906a341ebcb83c5c5561d96.zip
wlan: Provide runtime option to enable or disable rssi threshold (opt)
RSSI threshold check in AutoJoin feature will not allow to connect if AP's RSSI is low, this option will allow user to configure through advance setting application. Conflicts: service/java/com/android/server/wifi/WifiAutoJoinController.java Change-Id: Ifd6538b564a3485642dce1e33f70194f89cb5f61 CRs-Fixed: 710284 Conflicts: service/java/com/android/server/wifi/WifiAutoJoinController.java
-rw-r--r--service/java/com/android/server/wifi/WifiAutoJoinController.java27
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java4
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java4
3 files changed, 27 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/WifiAutoJoinController.java b/service/java/com/android/server/wifi/WifiAutoJoinController.java
index b7aa06a67..5efeb1146 100644
--- a/service/java/com/android/server/wifi/WifiAutoJoinController.java
+++ b/service/java/com/android/server/wifi/WifiAutoJoinController.java
@@ -50,6 +50,7 @@ public class WifiAutoJoinController {
private WifiNetworkScoreCache mNetworkScoreCache;
private static final String TAG = "WifiAutoJoinController ";
+ private static boolean mRssiThreshold = false;
private static boolean DBG = false;
private static boolean VDBG = false;
private static final boolean mStaStaSupported = false;
@@ -119,6 +120,14 @@ public class WifiAutoJoinController {
}
}
+ void enableRssiThreshold(int enabled) {
+ if (enabled > 0 ) {
+ mRssiThreshold = true;
+ } else {
+ mRssiThreshold = false;
+ }
+ }
+
void enableVerboseLogging(int verbose) {
if (verbose > 0 ) {
DBG = true;
@@ -1261,10 +1270,12 @@ public class WifiAutoJoinController {
}
}
+ if (DBG) logDbg("Rssi Threshold check " + mRssiThreshold);
+
// Try to unblacklist based on good visibility
- if (config.visibility.rssi5 < mWifiConfigStore.thresholdUnblacklistThreshold5Soft
- && config.visibility.rssi24
- < mWifiConfigStore.thresholdUnblacklistThreshold24Soft) {
+ if ((mRssiThreshold) &&
+ (config.visibility.rssi5 < mWifiConfigStore.thresholdUnblacklistThreshold5Soft
+ && config.visibility.rssi24 < mWifiConfigStore.thresholdUnblacklistThreshold24Soft)) {
if (DBG) {
logDbg("attemptAutoJoin do not unblacklist due to low visibility "
+ config.autoJoinStatus
@@ -1274,9 +1285,9 @@ public class WifiAutoJoinController {
+ ") num=(" + config.visibility.num24
+ "," + config.visibility.num5 + ")");
}
- } else if (config.visibility.rssi5 < mWifiConfigStore.thresholdUnblacklistThreshold5Hard
- && config.visibility.rssi24
- < mWifiConfigStore.thresholdUnblacklistThreshold24Hard) {
+ } else if ((mRssiThreshold) &&
+ (config.visibility.rssi5 < mWifiConfigStore.thresholdUnblacklistThreshold5Hard
+ && config.visibility.rssi24 < mWifiConfigStore.thresholdUnblacklistThreshold24Hard)) {
// If the network is simply temporary disabled, don't allow reconnect until
// RSSI becomes good enough
config.setAutoJoinStatus(config.autoJoinStatus - 1);
@@ -1332,10 +1343,10 @@ public class WifiAutoJoinController {
continue;
}
int boost = config.autoJoinUseAggressiveJoinAttemptThreshold + weakRssiBailCount;
- if ((config.visibility.rssi5 + boost)
+ if ((mRssiThreshold) && ((config.visibility.rssi5 + boost)
< mWifiConfigStore.thresholdInitialAutoJoinAttemptMin5RSSI
&& (config.visibility.rssi24 + boost)
- < mWifiConfigStore.thresholdInitialAutoJoinAttemptMin24RSSI) {
+ < mWifiConfigStore.thresholdInitialAutoJoinAttemptMin24RSSI)) {
if (DBG) {
logDbg("attemptAutoJoin skip due to low visibility -> status="
+ config.autoJoinStatus
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index 327d04361..a309b3ef8 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1770,6 +1770,10 @@ public final class WifiServiceImpl extends IWifiManager.Stub {
mWifiStateMachine.enableVerboseLogging(verbose);
}
+ public void enableRssiThreshold(int enabled) {
+ mWifiStateMachine.enableRssiThreshold(enabled);
+ }
+
public int getVerboseLoggingLevel() {
enforceAccessPermission();
return mWifiStateMachine.getVerboseLoggingLevel();
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 6f4c4059a..5e3b3f93e 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -1075,6 +1075,10 @@ public class WifiStateMachine extends StateMachine {
return mVerboseLoggingLevel;
}
+ void enableRssiThreshold(int enabled) {
+ mWifiAutoJoinController.enableRssiThreshold(enabled);
+ }
+
void enableVerboseLogging(int verbose) {
mVerboseLoggingLevel = verbose;
if (verbose > 0) {