public class EthernetDataTracker extends Object implements NetworkStateTracker
EVENT_CONFIGURATION_CHANGED, EVENT_NETWORK_SUBTYPE_CHANGED, EVENT_RESTORE_DEFAULT_NETWORK, EVENT_STATE_CHANGED
Modifier and Type | Method and Description |
---|---|
void |
captivePortalCheckComplete()
Ready to switch on to the network after captive portal check
|
Object |
Clone() |
void |
defaultRouteSet(boolean enabled)
Set a flag indicating default route is set for the network
|
void |
disconnect() |
int |
getDefaultGatewayAddr()
Fetch default gateway address for the network
|
static EthernetDataTracker |
getInstance() |
LinkCapabilities |
getLinkCapabilities()
A capability is an Integer/String pair, the capabilities
are defined in the class LinkSocket#Key.
|
LinkProperties |
getLinkProperties()
Fetch LinkProperties for the network
|
NetworkInfo |
getNetworkInfo()
Fetch NetworkInfo for the network
|
String |
getTcpBufferSizesPropName()
Return the system properties name associated with the tcp buffer sizes
for this network.
|
boolean |
isAvailable()
Returns an indication of whether this network is available for
connections.
|
boolean |
isDefaultRouteSet()
Check if default route is set
|
boolean |
isPrivateDnsRouteSet()
Check if private DNS route is set for the network
|
boolean |
isTeardownRequested()
Check if tear down was requested
|
void |
privateDnsRouteSet(boolean enabled)
Set a flag indicating private DNS route is set
|
boolean |
reconnect()
Re-enable connectivity to a network after a
teardown() . |
void |
setDependencyMet(boolean met)
An external dependency has been met/unmet
|
void |
setPolicyDataEnable(boolean enabled)
Policy control of data connection through this network, typically not
persisted internally.
|
boolean |
setRadio(boolean turnOn)
Turn the wireless radio off for a network.
|
void |
setTeardownRequested(boolean isRequested)
Indicate tear down requested from connectivity
|
void |
setUserDataEnable(boolean enabled)
User control of data connection through this network, typically persisted
internally.
|
void |
startMonitoring(Context context,
Handler target)
Begin monitoring connectivity
|
int |
startUsingNetworkFeature(String feature,
int callingPid,
int callingUid)
Tells the underlying networking system that the caller wants to
begin using the named feature.
|
int |
stopUsingNetworkFeature(String feature,
int callingPid,
int callingUid)
Tells the underlying networking system that the caller is finished
using the named feature.
|
boolean |
teardown()
Disable connectivity to a network
TODO: do away with return value after making MobileDataStateTracker async
|
public void disconnect()
public static EthernetDataTracker getInstance()
public Object Clone() throws CloneNotSupportedException
CloneNotSupportedException
public void setTeardownRequested(boolean isRequested)
NetworkStateTracker
setTeardownRequested
in interface NetworkStateTracker
public boolean isTeardownRequested()
NetworkStateTracker
isTeardownRequested
in interface NetworkStateTracker
public void startMonitoring(Context context, Handler target)
startMonitoring
in interface NetworkStateTracker
context
- is the current Android contexttarget
- is the Hander to which to return the events.public boolean teardown()
teardown
in interface NetworkStateTracker
true
if a teardown occurred, false
if the
teardown did not occur.public boolean reconnect()
teardown()
.reconnect
in interface NetworkStateTracker
true
if we're connected or expect to be connectedpublic void captivePortalCheckComplete()
NetworkStateTracker
captivePortalCheckComplete
in interface NetworkStateTracker
public boolean setRadio(boolean turnOn)
setRadio
in interface NetworkStateTracker
turnOn
- true
to turn the radio on, false
public boolean isAvailable()
NetworkStateTracker
false
means that some quasi-permanent
condition prevents connectivity to this network.
NOTE that this is broken on multi-connection devices. Should be fixed in J release
TODO - fix on multi-pdp devicesisAvailable
in interface NetworkStateTracker
public int startUsingNetworkFeature(String feature, int callingPid, int callingUid)
feature
is completely up to each networking implementation.feature
- the name of the feature to be usedcallingPid
- the process ID of the process that is issuing this requestcallingUid
- the user ID of the process that is issuing this request-1
always indicates failure.
TODO: needs to go awaypublic int stopUsingNetworkFeature(String feature, int callingPid, int callingUid)
feature
is completely up to each networking implementation.feature
- the name of the feature that is no longer needed.callingPid
- the process ID of the process that is issuing this requestcallingUid
- the user ID of the process that is issuing this request-1
always indicates failure.
TODO: needs to go awaypublic void setUserDataEnable(boolean enabled)
NetworkStateTracker
setUserDataEnable
in interface NetworkStateTracker
public void setPolicyDataEnable(boolean enabled)
NetworkStateTracker
NetworkPolicy.limitBytes
is passed.setPolicyDataEnable
in interface NetworkStateTracker
public boolean isPrivateDnsRouteSet()
isPrivateDnsRouteSet
in interface NetworkStateTracker
public void privateDnsRouteSet(boolean enabled)
privateDnsRouteSet
in interface NetworkStateTracker
public NetworkInfo getNetworkInfo()
getNetworkInfo
in interface NetworkStateTracker
public LinkProperties getLinkProperties()
getLinkProperties
in interface NetworkStateTracker
public LinkCapabilities getLinkCapabilities()
getLinkCapabilities
in interface NetworkStateTracker
public int getDefaultGatewayAddr()
public boolean isDefaultRouteSet()
isDefaultRouteSet
in interface NetworkStateTracker
public void defaultRouteSet(boolean enabled)
defaultRouteSet
in interface NetworkStateTracker
public String getTcpBufferSizesPropName()
getTcpBufferSizesPropName
in interface NetworkStateTracker
public void setDependencyMet(boolean met)
NetworkStateTracker
setDependencyMet
in interface NetworkStateTracker