Package org.robolectric.shadows
Class ShadowNetworkInfo
java.lang.Object
org.robolectric.shadows.ShadowNetworkInfo
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected static voidprotected NetworkInfo.DetailedStateprotected NetworkInfo.StategetState()protected intprotected intgetType()protected booleanprotected booleanprotected booleanstatic NetworkInfonewInstance(NetworkInfo.DetailedState detailedState, int type, int subType, boolean isAvailable, boolean isConnected) Deprecated.static NetworkInfonewInstance(NetworkInfo.DetailedState detailedState, int type, int subType, boolean isAvailable, NetworkInfo.State state) Allows developers to create aNetworkInfoinstance for testing.voidsetAvailableStatus(boolean isAvailable) Sets up the return value ofisAvailable().voidsetConnectionStatus(boolean isConnected) Deprecated.usesetConnectionStatus(NetworkInfo.State)insteadvoidSets up the return value ofgetState().voidsetConnectionType(int connectionType) Sets up the return value ofgetType().voidsetDetailedState(NetworkInfo.DetailedState detailedState) voidsetExtraInfo(String extraInfo) voidsetSubType(int subType) 
- 
Constructor Details- 
ShadowNetworkInfopublic ShadowNetworkInfo()
 
- 
- 
Method Details- 
__staticInitializer__
- 
newInstance@Deprecated public static NetworkInfo newInstance(NetworkInfo.DetailedState detailedState, int type, int subType, boolean isAvailable, boolean isConnected) Deprecated.
- 
newInstancepublic static NetworkInfo newInstance(NetworkInfo.DetailedState detailedState, int type, int subType, boolean isAvailable, NetworkInfo.State state) Allows developers to create aNetworkInfoinstance for testing.
- 
isConnected
- 
isConnectedOrConnecting
- 
getState
- 
getDetailedState
- 
getType
- 
getSubtype
- 
isAvailable
- 
setAvailableStatuspublic void setAvailableStatus(boolean isAvailable) Sets up the return value ofisAvailable().- Parameters:
- isAvailable- the value that- isAvailable()will return.
 
- 
setConnectionStatusDeprecated.usesetConnectionStatus(NetworkInfo.State)insteadSets up the return value ofisConnectedOrConnecting(),isConnected(), andgetState(). If the input is true, state will beNetworkInfo.State.CONNECTED, else it will beNetworkInfo.State.DISCONNECTED.- Parameters:
- isConnected- the value that- isConnectedOrConnecting()and- isConnected()will return.
 
- 
setConnectionStatusSets up the return value ofgetState().- Parameters:
- state- the value that- getState()will return.
 
- 
setConnectionTypepublic void setConnectionType(int connectionType) Sets up the return value ofgetType().- Parameters:
- connectionType- the value that- getType()will return.
 
- 
setSubTypepublic void setSubType(int subType) 
- 
setDetailedState
- 
setExtraInfo
 
- 
newInstance(NetworkInfo.DetailedState, int, int, boolean, NetworkInfo.State)instead