@Implements(value=android.net.NetworkInfo.class) public class ShadowNetworkInfo extends java.lang.Object
Constructor and Description |
---|
ShadowNetworkInfo() |
Modifier and Type | Method and Description |
---|---|
protected static void |
__staticInitializer__() |
protected android.net.NetworkInfo.DetailedState |
getDetailedState() |
protected android.net.NetworkInfo.State |
getState() |
protected int |
getSubtype() |
protected int |
getType() |
protected boolean |
isAvailable() |
protected boolean |
isConnected() |
protected boolean |
isConnectedOrConnecting() |
static android.net.NetworkInfo |
newInstance(android.net.NetworkInfo.DetailedState detailedState,
int type,
int subType,
boolean isAvailable,
boolean isConnected)
Deprecated.
|
static android.net.NetworkInfo |
newInstance(android.net.NetworkInfo.DetailedState detailedState,
int type,
int subType,
boolean isAvailable,
android.net.NetworkInfo.State state)
Allows developers to create a
NetworkInfo instance for testing. |
void |
setAvailableStatus(boolean isAvailable)
Sets up the return value of
isAvailable() . |
void |
setConnectionStatus(boolean isConnected)
Deprecated.
use
setConnectionStatus(NetworkInfo.State) instead |
void |
setConnectionStatus(android.net.NetworkInfo.State state)
Sets up the return value of
getState() . |
void |
setConnectionType(int connectionType)
Sets up the return value of
getType() . |
void |
setDetailedState(android.net.NetworkInfo.DetailedState detailedState) |
void |
setSubType(int subType) |
@Implementation protected static void __staticInitializer__()
@Deprecated public static android.net.NetworkInfo newInstance(android.net.NetworkInfo.DetailedState detailedState, int type, int subType, boolean isAvailable, boolean isConnected)
newInstance(NetworkInfo.DetailedState, int, int, boolean,
NetworkInfo.State)
insteadpublic static android.net.NetworkInfo newInstance(android.net.NetworkInfo.DetailedState detailedState, int type, int subType, boolean isAvailable, android.net.NetworkInfo.State state)
Allows developers to create a NetworkInfo
instance for testing.
@Implementation protected boolean isConnected()
@Implementation protected boolean isConnectedOrConnecting()
@Implementation protected android.net.NetworkInfo.State getState()
@Implementation protected android.net.NetworkInfo.DetailedState getDetailedState()
@Implementation protected int getType()
@Implementation protected int getSubtype()
@Implementation protected boolean isAvailable()
public void setAvailableStatus(boolean isAvailable)
Sets up the return value of isAvailable()
.
isAvailable
- the value that isAvailable()
will return.@Deprecated public void setConnectionStatus(boolean isConnected)
setConnectionStatus(NetworkInfo.State)
insteadSets up the return value of isConnectedOrConnecting()
, isConnected()
, and getState()
. If the input is true, state will be NetworkInfo.State#CONNECTED
, else it will be NetworkInfo.State#DISCONNECTED
.
isConnected
- the value that isConnectedOrConnecting()
and isConnected()
will return.public void setConnectionStatus(android.net.NetworkInfo.State state)
Sets up the return value of getState()
.
state
- the value that getState()
will return.public void setConnectionType(int connectionType)
Sets up the return value of getType()
.
connectionType
- the value that getType()
will return.public void setSubType(int subType)
public void setDetailedState(android.net.NetworkInfo.DetailedState detailedState)