Remove explicit network disabling code
We are going to always disable the notification Bug: 5556629 Change-Id: I981eb55a1bb6f44defd674e3a86d9c6f3805f4fc
This commit is contained in:
@@ -70,7 +70,6 @@ public class WifiInfo implements Parcelable {
|
||||
private InetAddress mIpAddress;
|
||||
|
||||
private String mMacAddress;
|
||||
private boolean mExplicitConnect;
|
||||
|
||||
WifiInfo() {
|
||||
mSSID = null;
|
||||
@@ -80,7 +79,6 @@ public class WifiInfo implements Parcelable {
|
||||
mRssi = -9999;
|
||||
mLinkSpeed = -1;
|
||||
mHiddenSSID = false;
|
||||
mExplicitConnect = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +96,6 @@ public class WifiInfo implements Parcelable {
|
||||
mLinkSpeed = source.mLinkSpeed;
|
||||
mIpAddress = source.mIpAddress;
|
||||
mMacAddress = source.mMacAddress;
|
||||
mExplicitConnect = source.mExplicitConnect;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,22 +172,6 @@ public class WifiInfo implements Parcelable {
|
||||
mNetworkId = id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public boolean isExplicitConnect() {
|
||||
return mExplicitConnect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public void setExplicitConnect(boolean explicitConnect) {
|
||||
this.mExplicitConnect = explicitConnect;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Each configured network has a unique small integer ID, used to identify
|
||||
* the network when performing operations on the supplicant. This method
|
||||
@@ -279,8 +260,7 @@ public class WifiInfo implements Parcelable {
|
||||
append(mSupplicantState == null ? none : mSupplicantState).
|
||||
append(", RSSI: ").append(mRssi).
|
||||
append(", Link speed: ").append(mLinkSpeed).
|
||||
append(", Net ID: ").append(mNetworkId).
|
||||
append(", Explicit connect: ").append(mExplicitConnect);
|
||||
append(", Net ID: ").append(mNetworkId);
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -304,7 +284,6 @@ public class WifiInfo implements Parcelable {
|
||||
dest.writeString(getSSID());
|
||||
dest.writeString(mBSSID);
|
||||
dest.writeString(mMacAddress);
|
||||
dest.writeByte(mExplicitConnect ? (byte)1 : (byte)0);
|
||||
mSupplicantState.writeToParcel(dest, flags);
|
||||
}
|
||||
|
||||
@@ -324,7 +303,6 @@ public class WifiInfo implements Parcelable {
|
||||
info.setSSID(in.readString());
|
||||
info.mBSSID = in.readString();
|
||||
info.mMacAddress = in.readString();
|
||||
info.mExplicitConnect = in.readByte() == 1 ? true : false;
|
||||
info.mSupplicantState = SupplicantState.CREATOR.createFromParcel(in);
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -533,11 +533,6 @@ public class WifiStateMachine extends StateMachine {
|
||||
private final WorkSource mLastRunningWifiUids = new WorkSource();
|
||||
|
||||
private final IBatteryStats mBatteryStats;
|
||||
private boolean mNextWifiActionExplicit = false;
|
||||
private int mLastExplicitNetworkId;
|
||||
private long mLastNetworkChoiceTime;
|
||||
private static final long EXPLICIT_CONNECT_ALLOWED_DELAY_MS = 2 * 60 * 1000;
|
||||
|
||||
|
||||
public WifiStateMachine(Context context, String wlanInterface) {
|
||||
super(TAG);
|
||||
@@ -1637,7 +1632,6 @@ public class WifiStateMachine extends StateMachine {
|
||||
mWifiInfo.setNetworkId(WifiConfiguration.INVALID_NETWORK_ID);
|
||||
mWifiInfo.setRssi(MIN_RSSI);
|
||||
mWifiInfo.setLinkSpeed(-1);
|
||||
mWifiInfo.setExplicitConnect(false);
|
||||
|
||||
/* send event to CM & network change broadcast */
|
||||
setNetworkDetailedState(DetailedState.DISCONNECTED);
|
||||
@@ -2821,10 +2815,6 @@ public class WifiStateMachine extends StateMachine {
|
||||
mSupplicantStateTracker.sendMessage(CMD_CONNECT_NETWORK);
|
||||
|
||||
WifiNative.reconnectCommand();
|
||||
mLastExplicitNetworkId = netId;
|
||||
mLastNetworkChoiceTime = SystemClock.elapsedRealtime();
|
||||
mNextWifiActionExplicit = true;
|
||||
if (DBG) log("Setting wifi connect explicit for netid " + netId);
|
||||
/* Expect a disconnection from the old connection */
|
||||
transitionTo(mDisconnectingState);
|
||||
break;
|
||||
@@ -2846,13 +2836,6 @@ public class WifiStateMachine extends StateMachine {
|
||||
mWifiInfo.setSSID(fetchSSID());
|
||||
mWifiInfo.setBSSID(mLastBssid);
|
||||
mWifiInfo.setNetworkId(mLastNetworkId);
|
||||
if (mNextWifiActionExplicit &&
|
||||
mWifiInfo.getNetworkId() == mLastExplicitNetworkId &&
|
||||
SystemClock.elapsedRealtime() < mLastNetworkChoiceTime +
|
||||
EXPLICIT_CONNECT_ALLOWED_DELAY_MS) {
|
||||
mWifiInfo.setExplicitConnect(true);
|
||||
}
|
||||
mNextWifiActionExplicit = false;
|
||||
/* send event to CM & network change broadcast */
|
||||
setNetworkDetailedState(DetailedState.OBTAINING_IPADDR);
|
||||
sendNetworkStateChangeBroadcast(mLastBssid);
|
||||
|
||||
@@ -1030,7 +1030,7 @@ public class WifiWatchdogStateMachine extends StateMachine {
|
||||
mHasConnectedWifiManager = true;
|
||||
}
|
||||
mWifiManager.disableNetwork(networkId, WifiConfiguration.DISABLED_DNS_FAILURE);
|
||||
if (mShowDisabledNotification && mConnectionInfo.isExplicitConnect()) {
|
||||
if (mShowDisabledNotification) {
|
||||
setDisabledNetworkNotificationVisible(true);
|
||||
}
|
||||
transitionTo(mNotConnectedState);
|
||||
|
||||
Reference in New Issue
Block a user