public class DummyDataStateTracker extends Object implements NetworkStateTracker
EVENT_CONFIGURATION_CHANGED, EVENT_NETWORK_SUBTYPE_CHANGED, EVENT_RESTORE_DEFAULT_NETWORK, EVENT_STATE_CHANGED
Constructor and Description |
---|
DummyDataStateTracker(int netType,
String tag)
Create a new DummyDataStateTracker
|
Modifier and Type | Method and Description |
---|---|
void |
captivePortalCheckComplete()
Ready to switch on to the network after captive portal check
|
void |
defaultRouteSet(boolean enabled)
Set a flag indicating default route is set for the network
|
LinkCapabilities |
getLinkCapabilities()
A capability is an Integer/String pair, the capabilities
are defined in the class LinkSocket#Key.
|
LinkProperties |
getLinkProperties()
Return the LinkProperties for the connection.
|
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()
Report whether data connectivity is possible.
|
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 mobile data connectivity after a
teardown() . |
void |
releaseWakeLock()
This is not implemented.
|
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 on or off the mobile radio.
|
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 data connectivity.
|
boolean |
teardown()
Tear down mobile data connectivity, i.e., disable the ability to create
mobile data connections.
|
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
public DummyDataStateTracker(int netType, String tag)
netType
- the ConnectivityManager network typetag
- the name of this networkpublic void startMonitoring(Context context, Handler target)
startMonitoring
in interface NetworkStateTracker
context
- is the current Android contexttarget
- is the Handler to which to return the events.public boolean isPrivateDnsRouteSet()
NetworkStateTracker
isPrivateDnsRouteSet
in interface NetworkStateTracker
public void privateDnsRouteSet(boolean enabled)
NetworkStateTracker
privateDnsRouteSet
in interface NetworkStateTracker
public NetworkInfo getNetworkInfo()
NetworkStateTracker
getNetworkInfo
in interface NetworkStateTracker
public boolean isDefaultRouteSet()
NetworkStateTracker
isDefaultRouteSet
in interface NetworkStateTracker
public void defaultRouteSet(boolean enabled)
NetworkStateTracker
defaultRouteSet
in interface NetworkStateTracker
public void releaseWakeLock()
public boolean isAvailable()
isAvailable
in interface NetworkStateTracker
public String getTcpBufferSizesPropName()
getTcpBufferSizesPropName
in interface NetworkStateTracker
public boolean teardown()
teardown
in interface NetworkStateTracker
true
if a teardown occurred, false
if the
teardown did not occur.public void captivePortalCheckComplete()
NetworkStateTracker
captivePortalCheckComplete
in interface NetworkStateTracker
public void setTeardownRequested(boolean isRequested)
NetworkStateTracker
setTeardownRequested
in interface NetworkStateTracker
public boolean isTeardownRequested()
NetworkStateTracker
isTeardownRequested
in interface NetworkStateTracker
public boolean reconnect()
teardown()
.
TODO - make async and always get a notification?reconnect
in interface NetworkStateTracker
true
if we're connected or expect to be connectedpublic boolean setRadio(boolean turnOn)
setRadio
in interface NetworkStateTracker
turnOn
- true
if the radio should be turned on, false
ifpublic void setUserDataEnable(boolean enabled)
NetworkStateTracker
setUserDataEnable
in interface NetworkStateTracker
public void setPolicyDataEnable(boolean enabled)
NetworkStateTracker
NetworkPolicy.limitBytes
is passed.setPolicyDataEnable
in interface NetworkStateTracker
public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
public LinkProperties getLinkProperties()
NetworkStateTracker
getLinkProperties
in interface NetworkStateTracker
NetworkStateTracker.getLinkProperties()
public LinkCapabilities getLinkCapabilities()
NetworkStateTracker
getLinkCapabilities
in interface NetworkStateTracker
NetworkStateTracker.getLinkCapabilities()
public void setDependencyMet(boolean met)
NetworkStateTracker
setDependencyMet
in interface NetworkStateTracker