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:
@@ -1328,24 +1328,6 @@ public class ConnectivityManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Signal that the captive portal check on the indicated network
|
|
||||||
* is complete and we can turn the network on for general use.
|
|
||||||
*
|
|
||||||
* @param info the {@link NetworkInfo} object for the networkType
|
|
||||||
* in question.
|
|
||||||
*
|
|
||||||
* <p>This method requires the call to hold the permission
|
|
||||||
* {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}.
|
|
||||||
* {@hide}
|
|
||||||
*/
|
|
||||||
public void captivePortalCheckComplete(NetworkInfo info) {
|
|
||||||
try {
|
|
||||||
mService.captivePortalCheckComplete(info);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signal that the captive portal check on the indicated network
|
* Signal that the captive portal check on the indicated network
|
||||||
* is complete and whether its a captive portal or not.
|
* is complete and whether its a captive portal or not.
|
||||||
|
|||||||
@@ -129,8 +129,6 @@ interface IConnectivityManager
|
|||||||
|
|
||||||
boolean updateLockdownVpn();
|
boolean updateLockdownVpn();
|
||||||
|
|
||||||
void captivePortalCheckComplete(in NetworkInfo info);
|
|
||||||
|
|
||||||
void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal);
|
void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal);
|
||||||
|
|
||||||
void supplyMessenger(int networkType, in Messenger messenger);
|
void supplyMessenger(int networkType, in Messenger messenger);
|
||||||
|
|||||||
@@ -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 */
|
/** @hide */
|
||||||
@Override
|
@Override
|
||||||
public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
|
public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
|
||||||
@@ -2972,9 +2942,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
if (info.getDetailedState() ==
|
if (info.getDetailedState() ==
|
||||||
NetworkInfo.DetailedState.FAILED) {
|
NetworkInfo.DetailedState.FAILED) {
|
||||||
handleConnectionFailure(info);
|
handleConnectionFailure(info);
|
||||||
} else if (info.getDetailedState() ==
|
|
||||||
DetailedState.CAPTIVE_PORTAL_CHECK) {
|
|
||||||
handleCaptivePortalTrackerCheck(info);
|
|
||||||
} else if (info.isConnectedToProvisioningNetwork()) {
|
} else if (info.isConnectedToProvisioningNetwork()) {
|
||||||
/**
|
/**
|
||||||
* TODO: Create ConnectivityManager.TYPE_MOBILE_PROVISIONING
|
* TODO: Create ConnectivityManager.TYPE_MOBILE_PROVISIONING
|
||||||
|
|||||||
Reference in New Issue
Block a user