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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BluetoothSocketaccept(int timeout)May block the current thread and wait untilBluetoothDeviceis offered viadeviceConnected(BluetoothDevice)method or timeout occurred.protected voidclose()BluetoothSocketdeviceConnected(BluetoothDevice device)CreatesBluetoothSocketfor the given device and makes this socket available immediately in theaccept(int)method.static BluetoothServerSocketnewInstance(int type, boolean auth, boolean encrypt, ParcelUuid uuid)
-
-
-
Method Detail
-
newInstance
public static BluetoothServerSocket newInstance(int type, boolean auth, boolean encrypt, ParcelUuid uuid)
-
accept
@Implementation protected BluetoothSocket accept(int timeout) throws IOException
May block the current thread and wait untilBluetoothDeviceis 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
@Implementation protected void close() throws IOException
- Throws:
IOException
-
deviceConnected
public BluetoothSocket deviceConnected(BluetoothDevice device)
CreatesBluetoothSocketfor the given device and makes this socket available immediately in theaccept(int)method.
-
-