am 02eab434: am f42ca169: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev

* commit '02eab434ad9faa25291e63023b7e66698ca457a8':
  If in a mobile captive portal is detected enable fail fast.
This commit is contained in:
Wink Saville
2013-08-08 15:46:55 -07:00
committed by Android Git Automerger
3 changed files with 32 additions and 0 deletions

View File

@@ -1282,6 +1282,25 @@ public class ConnectivityManager {
} }
} }
/**
* Signal that the captive portal check on the indicated network
* is complete and whether its a captive portal or not.
*
* @param info the {@link NetworkInfo} object for the networkType
* in question.
* @param isCaptivePortal true/false.
*
* <p>This method requires the call to hold the permission
* {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}.
* {@hide}
*/
public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
try {
mService.captivePortalCheckCompleted(info, isCaptivePortal);
} catch (RemoteException e) {
}
}
/** /**
* Supply the backend messenger for a network tracker * Supply the backend messenger for a network tracker
* *

View File

@@ -129,6 +129,8 @@ interface IConnectivityManager
void captivePortalCheckComplete(in NetworkInfo info); void captivePortalCheckComplete(in NetworkInfo info);
void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal);
void supplyMessenger(int networkType, in Messenger messenger); void supplyMessenger(int networkType, in Messenger messenger);
int findConnectionTypeForIface(in String iface); int findConnectionTypeForIface(in String iface);

View File

@@ -2169,15 +2169,26 @@ public class ConnectivityService extends IConnectivityManager.Stub {
} }
} }
if (DBG) log("handleCaptivePortalTrackerCheck: call captivePortalCheckComplete ni=" + info);
thisNet.captivePortalCheckComplete(); thisNet.captivePortalCheckComplete();
} }
/** @hide */ /** @hide */
@Override
public void captivePortalCheckComplete(NetworkInfo info) { public void captivePortalCheckComplete(NetworkInfo info) {
enforceConnectivityInternalPermission(); enforceConnectivityInternalPermission();
if (DBG) log("captivePortalCheckComplete: ni=" + info);
mNetTrackers[info.getType()].captivePortalCheckComplete(); mNetTrackers[info.getType()].captivePortalCheckComplete();
} }
/** @hide */
@Override
public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
enforceConnectivityInternalPermission();
if (DBG) log("captivePortalCheckCompleted: ni=" + info + " captive=" + isCaptivePortal);
mNetTrackers[info.getType()].captivePortalCheckCompleted(isCaptivePortal);
}
/** /**
* Setup data activity tracking for the given network interface. * Setup data activity tracking for the given network interface.
* *