Remove captive portal code that has no effect.

Note that this CL does not change any behaviour.

At the center of this change is
CaptivePortalTracker#detectCaptivePortal(), which does nothing
except call back into ConnectivityService. Removing it allows us to
simplify code in ConnectivityService. It also allows us to remove
ConnectivityService#captivePortalCheckComplete which was only ever
called in response to this method.

While this does not change any behaviour, it preserves existing
bad behaviour, i.e, that the CAPTIVE_PORTAL_CHECK NetworkInfo
state does not correspond to actual captive portal detection.
We transition into that state and immediately (and unconditionally)
out of it and into CONNECTED.

Change-Id: Ib3797f956d2db5e3cacaaa53e899d81aa8e958af
This commit is contained in:
Narayan Kamath
2013-08-29 13:40:43 +01:00
parent 5fc45ec60d
commit ab03543323
3 changed files with 0 additions and 53 deletions

View File

@@ -2316,36 +2316,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
}
}
private void handleCaptivePortalTrackerCheck(NetworkInfo info) {
if (DBG) log("Captive portal check " + info);
int type = info.getType();
final NetworkStateTracker thisNet = mNetTrackers[type];
if (mNetConfigs[type].isDefault()) {
if (mActiveDefaultNetwork != -1 && mActiveDefaultNetwork != type) {
if (isNewNetTypePreferredOverCurrentNetType(type)) {
if (DBG) log("Captive check on " + info.getTypeName());
mCaptivePortalTracker.detectCaptivePortal(new NetworkInfo(info));
return;
} else {
if (DBG) log("Tear down low priority net " + info.getTypeName());
teardown(thisNet);
return;
}
}
}
if (DBG) log("handleCaptivePortalTrackerCheck: call captivePortalCheckComplete ni=" + info);
thisNet.captivePortalCheckComplete();
}
/** @hide */
@Override
public void captivePortalCheckComplete(NetworkInfo info) {
enforceConnectivityInternalPermission();
if (DBG) log("captivePortalCheckComplete: ni=" + info);
mNetTrackers[info.getType()].captivePortalCheckComplete();
}
/** @hide */
@Override
public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
@@ -2972,9 +2942,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
if (info.getDetailedState() ==
NetworkInfo.DetailedState.FAILED) {
handleConnectionFailure(info);
} else if (info.getDetailedState() ==
DetailedState.CAPTIVE_PORTAL_CHECK) {
handleCaptivePortalTrackerCheck(info);
} else if (info.isConnectedToProvisioningNetwork()) {
/**
* TODO: Create ConnectivityManager.TYPE_MOBILE_PROVISIONING