Package org.robolectric.shadows
Class ShadowBluetoothServerSocket
java.lang.Object
org.robolectric.shadows.ShadowBluetoothServerSocket
@Implements(android.bluetooth.BluetoothServerSocket.class) public class ShadowBluetoothServerSocket extends Object
-
Constructor Summary
Constructors Constructor Description ShadowBluetoothServerSocket()
-
Method Summary
Modifier and Type Method Description protected BluetoothSocket
accept(int timeout)
May block the current thread and wait untilBluetoothDevice
is offered viadeviceConnected(BluetoothDevice)
method or timeout occurred.protected void
close()
BluetoothSocket
deviceConnected(BluetoothDevice device)
CreatesBluetoothSocket
for the given device and makes this socket available immediately in theaccept(int)
method.static BluetoothServerSocket
newInstance(int type, boolean auth, boolean encrypt, ParcelUuid uuid)
-
Constructor Details
-
ShadowBluetoothServerSocket
public ShadowBluetoothServerSocket()
-
-
Method Details
-
newInstance
public static BluetoothServerSocket newInstance(int type, boolean auth, boolean encrypt, ParcelUuid uuid) -
accept
May block the current thread and wait untilBluetoothDevice
is offered viadeviceConnected(BluetoothDevice)
method or timeout occurred.- Returns:
- socket of the connected bluetooth device
- Throws:
IOException
- if socket has been closed, thread interrupted while waiting or timeout has occurred.
-
close
- Throws:
IOException
-
deviceConnected
CreatesBluetoothSocket
for the given device and makes this socket available immediately in theaccept(int)
method.
-