/**@class android.net.ConnectivityManager.NetworkCallback
@extends java.lang.Object
Base class for NetworkRequest callbacks. Used for notifications about network
changes. Should be extended by applications wanting notifications.
*/
var NetworkCallback = {
/**Called when the framework connects to a new network to evaluate whether it satisfies this
request. If evaluation succeeds, this callback may be followed by an {@link #onAvailable}
callback. There is no guarantee that this new network will satisfy any requests, or that
the network will stay connected for longer than the time necessary to evaluate it.
<p>
Most applications <b>should not</b> act on this callback, and should instead use
{@link #onAvailable}. This callback is intended for use by applications that can assist
the framework in properly evaluating the network — for example, an application that
can automatically log in to a captive portal without user intervention.
@param {Object {Network}} network The {@link Network} of the network that is being evaluated.
@hide
*/
onPreCheck : function( ) {},
/**Called when the framework connects and has declared a new network ready for use.
This callback may be called more than once if the {@link android.net.Network} that is
satisfying the request changes.
@param {Object {Network}} network The {@link Network} of the satisfying network.
*/
onAvailable : function( ) {},
/**Called when the network is about to be disconnected. Often paired with an
{@link android.net.ConnectivityManager.NetworkCallback#onAvailable} call with the new replacement network
for graceful handover. This may not be called if we have a hard loss
(loss without warning). This may be followed by either a
{@link android.net.ConnectivityManager.NetworkCallback#onLost} call or a
{@link android.net.ConnectivityManager.NetworkCallback#onAvailable} call for this network depending
on whether we lose or regain it.
@param {Object {Network}} network The {@link Network} that is about to be disconnected.
@param {Number} maxMsToLive The time in ms the framework will attempt to keep the
network connected. Note that the network may suffer a
hard loss at any time.
*/
onLosing : function( ) {},
/**Called when the framework has a hard loss of the network or when the
graceful failure ends.
@param {Object {Network}} network The {@link Network} lost.
*/
onLost : function( ) {},
/**Called if no network is found in the given timeout time. If no timeout is given,
this will not be called.
@hide
*/
onUnavailable : function( ) {},
/**Called when the network the framework connected to for this request
changes capabilities but still satisfies the stated need.
@param {Object {Network}} network The {@link Network} whose capabilities have changed.
@param {Object {NetworkCapabilities}} networkCapabilities The new {@link android.net.NetworkCapabilities} for this network.
*/
onCapabilitiesChanged : function( ) {},
/**Called when the network the framework connected to for this request
changes {@link android.net.LinkProperties}.
@param {Object {Network}} network The {@link Network} whose link properties have changed.
@param {Object {LinkProperties}} linkProperties The new {@link LinkProperties} for this network.
*/
onLinkPropertiesChanged : function( ) {},
/**Called when the network the framework connected to for this request
goes into {@link android.net.NetworkInfo.DetailedState.SUSPENDED}.
This generally means that while the TCP connections are still live,
temporarily network data fails to transfer. Specifically this is used
on cellular networks to mask temporary outages when driving through
a tunnel, etc.
@hide
*/
onNetworkSuspended : function( ) {},
/**Called when the network the framework connected to for this request
returns from a {@link android.net.NetworkInfo.DetailedState.SUSPENDED} state.
This should always be preceeded by a matching {@code onNetworkSuspended}
call.
@hide
*/
onNetworkResumed : function( ) {},
};