@Implements(value=android.net.Network.class, minSdk=21) public class ShadowNetwork extends Object
Constructor and Description |
---|
ShadowNetwork() |
Modifier and Type | Method and Description |
---|---|
protected void |
bindSocket(DatagramSocket socket)
No-ops.
|
protected void |
bindSocket(FileDescriptor fd)
No-ops.
|
protected void |
bindSocket(Socket socket)
No-ops.
|
int |
getNetId()
Allows to get the stored netId.
|
static Network |
newInstance(int netId)
Creates new instance of
Network , because its constructor is hidden. |
public static Network newInstance(int netId)
Creates new instance of Network
, because its constructor is hidden.
netId
- The netId.@Implementation(minSdk=22) protected void bindSocket(DatagramSocket socket)
No-ops. We cannot assume that a Network represents a real network interface on the device running this test, so we have nothing to bind the socket to.
@Implementation protected void bindSocket(Socket socket)
No-ops. We cannot assume that a Network represents a real network interface on the device running this test, so we have nothing to bind the socket to.
@Implementation(minSdk=23) protected void bindSocket(FileDescriptor fd)
No-ops. We cannot assume that a Network represents a real network interface on the device running this test, so we have nothing to bind the socket to.
public int getNetId()
Allows to get the stored netId.