Support requesting async LinkProperties/NetworkCapabilities updates

am: 0c04b74781

Change-Id: Icc048323debbbe641941c5c0d993f4c9782c5d3e
This commit is contained in:
Erik Kline 2016-07-11 11:01:42 +00:00 • committed by android-build-merger
commit b2bdeca8e2
2 changed files with 267 additions and 87 deletions

View file

@ -1034,6 +1034,26 @@ public class ConnectivityManager {
}
}
/**
* Request that this callback be invoked at ConnectivityService's earliest
* convenience with the current satisfying network's LinkProperties.
* If no such network exists no callback invocation is performed.
*
* The callback must have been registered with #requestNetwork() or
* #registerDefaultNetworkCallback(); callbacks registered with
* registerNetworkCallback() are not specific to any particular Network so
* do not cause any updates.
*
* @hide
*/
public void requestLinkProperties(NetworkCallback networkCallback) {
try {
mService.requestLinkProperties(networkCallback.networkRequest);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
/**
* Get the {@link android.net.NetworkCapabilities} for the given {@link Network}. This
* will return {@code null} if the network is unknown.
@ -1051,6 +1071,26 @@ public class ConnectivityManager {
}
}
/**
* Request that this callback be invoked at ConnectivityService's earliest
* convenience with the current satisfying network's NetworkCapabilities.
* If no such network exists no callback invocation is performed.
*
* The callback must have been registered with #requestNetwork() or
* #registerDefaultNetworkCallback(); callbacks registered with
* registerNetworkCallback() are not specific to any particular Network so
* do not cause any updates.
*
* @hide
*/
public void requestNetworkCapabilities(NetworkCallback networkCallback) {
try {
mService.requestNetworkCapabilities(networkCallback.networkRequest);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
/**
* Gets the URL that should be used for resolving whether a captive portal is present.
* 1. This URL should respond with a 204 response to a GET request to indicate no captive

View file

@ -156,6 +156,8 @@ interface IConnectivityManager
void pendingListenForNetwork(in NetworkCapabilities networkCapabilities,
in PendingIntent operation);
void requestLinkProperties(in NetworkRequest networkRequest);
void requestNetworkCapabilities(in NetworkRequest networkRequest);
void releaseNetworkRequest(in NetworkRequest networkRequest);
void setAcceptUnvalidated(in Network network, boolean accept, boolean always);