@Implements(value=android.net.NetworkInfo.class) public class ShadowNetworkInfo extends java.lang.Object
Constructor and Description |
---|
ShadowNetworkInfo() |
Modifier and Type | Method and Description |
---|---|
static void |
__staticInitializer__() |
android.net.NetworkInfo.DetailedState |
getDetailedState() |
android.net.NetworkInfo.State |
getState() |
int |
getSubtype() |
int |
getType() |
boolean |
isAvailable() |
boolean |
isConnected() |
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 public 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 public boolean isConnected()
@Implementation public boolean isConnectedOrConnecting()
@Implementation public android.net.NetworkInfo.State getState()
@Implementation public android.net.NetworkInfo.DetailedState getDetailedState()
@Implementation public int getType()
@Implementation public int getSubtype()
@Implementation public 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)