Skip to content

Commit 9f2a011

Browse files
isheriffAndroid (Google) Code Review
authored andcommitted
Merge "Remove indefinite DHCP retries" into froyo
2 parents f4a502a + 60d0d22 commit 9f2a011

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

wifi/java/android/net/wifi/WifiStateTracker.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public class WifiStateTracker extends NetworkStateTracker {
156156
* See {@link Settings.Secure#WIFI_MAX_DHCP_RETRY_COUNT}. This is the default
157157
* value if a Settings value is not present.
158158
*/
159-
private static final int DEFAULT_MAX_DHCP_RETRIES = 2;
159+
private static final int DEFAULT_MAX_DHCP_RETRIES = 9;
160160

161161
private static final int DRIVER_POWER_MODE_AUTO = 0;
162162
private static final int DRIVER_POWER_MODE_ACTIVE = 1;
@@ -1100,16 +1100,15 @@ public void handleMessage(Message msg) {
11001100
String BSSID = (msg.obj != null) ? msg.obj.toString() : null;
11011101
/**
11021102
* If we've exceeded the maximum number of retries for reconnecting
1103-
* to a given network, blacklist the BSSID to allow a connection attempt on
1104-
* an alternate BSSID if available
1103+
* to a given network, disable the network
11051104
*/
11061105
if (mWifiInfo.getSupplicantState() != SupplicantState.UNINITIALIZED) {
11071106
if (++mReconnectCount > getMaxDhcpRetries()) {
11081107
if (LOCAL_LOGD) {
11091108
Log.d(TAG, "Failed reconnect count: " +
1110-
mReconnectCount + " Blacklisting " + BSSID);
1109+
mReconnectCount + " Disabling " + BSSID);
11111110
}
1112-
addToBlacklist(BSSID);
1111+
mWM.disableNetwork(mLastNetworkId);
11131112
}
11141113
reconnectCommand();
11151114
}

0 commit comments

Comments
 (0)