Merge changes from topic 'cm_request_to'
am: d6877b2576
Change-Id: I9ca18c0570be831ab37cdf200c28b0778117198d
This commit is contained in:
@@ -2969,8 +2969,8 @@ public class ConnectivityManager {
|
|||||||
*
|
*
|
||||||
* This function behaves identically to the non-timedout version, but if a suitable
|
* This function behaves identically to the non-timedout version, but if a suitable
|
||||||
* network is not found within the given time (in milliseconds) the
|
* network is not found within the given time (in milliseconds) the
|
||||||
* {@link NetworkCallback#unavailable} callback is called. The request must
|
* {@link NetworkCallback#onUnavailable()} callback is called. The request must
|
||||||
* still be released normally by calling {@link unregisterNetworkCallback(NetworkCallback)}.
|
* still be released normally by calling {@link #unregisterNetworkCallback(NetworkCallback)}.
|
||||||
*
|
*
|
||||||
* <p>This method requires the caller to hold either the
|
* <p>This method requires the caller to hold either the
|
||||||
* {@link android.Manifest.permission#CHANGE_NETWORK_STATE} permission
|
* {@link android.Manifest.permission#CHANGE_NETWORK_STATE} permission
|
||||||
@@ -2982,10 +2982,7 @@ public class ConnectivityManager {
|
|||||||
* the callbacks must not be shared - they uniquely specify
|
* the callbacks must not be shared - they uniquely specify
|
||||||
* this request.
|
* this request.
|
||||||
* @param timeoutMs The time in milliseconds to attempt looking for a suitable network
|
* @param timeoutMs The time in milliseconds to attempt looking for a suitable network
|
||||||
* before {@link NetworkCallback#unavailable} is called.
|
* before {@link NetworkCallback#onUnavailable()} is called.
|
||||||
*
|
|
||||||
* TODO: Make timeouts work and then unhide this method.
|
|
||||||
*
|
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void requestNetwork(NetworkRequest request, NetworkCallback networkCallback,
|
public void requestNetwork(NetworkRequest request, NetworkCallback networkCallback,
|
||||||
@@ -2994,13 +2991,6 @@ public class ConnectivityManager {
|
|||||||
inferLegacyTypeForNetworkCapabilities(request.networkCapabilities));
|
inferLegacyTypeForNetworkCapabilities(request.networkCapabilities));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The maximum number of milliseconds the framework will look for a suitable network
|
|
||||||
* during a timeout-equiped call to {@link requestNetwork}.
|
|
||||||
* {@hide}
|
|
||||||
*/
|
|
||||||
public final static int MAX_NETWORK_REQUEST_TIMEOUT_MS = 100 * 60 * 1000;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The lookup key for a {@link Network} object included with the intent after
|
* The lookup key for a {@link Network} object included with the intent after
|
||||||
* successfully finding a network for the applications request. Retrieve it with
|
* successfully finding a network for the applications request. Retrieve it with
|
||||||
|
|||||||
@@ -4163,7 +4163,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
ensureRequestableCapabilities(networkCapabilities);
|
ensureRequestableCapabilities(networkCapabilities);
|
||||||
|
|
||||||
if (timeoutMs < 0 || timeoutMs > ConnectivityManager.MAX_NETWORK_REQUEST_TIMEOUT_MS) {
|
if (timeoutMs < 0) {
|
||||||
throw new IllegalArgumentException("Bad timeout specified");
|
throw new IllegalArgumentException("Bad timeout specified");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user