Package org.robolectric.shadows
Class ShadowBluetoothServerSocket
- java.lang.Object
-
- org.robolectric.shadows.ShadowBluetoothServerSocket
-
@Implements(android.bluetooth.BluetoothServerSocket.class) public class ShadowBluetoothServerSocket extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ShadowBluetoothServerSocket()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected android.bluetooth.BluetoothSocketaccept(int timeout)May block the current thread and wait untilBluetoothDeviceis offered viadeviceConnected(BluetoothDevice)method or timeout occurred.protected voidclose()android.bluetooth.BluetoothSocketdeviceConnected(android.bluetooth.BluetoothDevice device)CreatesBluetoothSocketfor the given device and makes this socket available immediately in theaccept(int)method.static android.bluetooth.BluetoothServerSocketnewInstance(int type, boolean auth, boolean encrypt, android.os.ParcelUuid uuid)
-
-
-
Method Detail
-
newInstance
public static android.bluetooth.BluetoothServerSocket newInstance(int type, boolean auth, boolean encrypt, android.os.ParcelUuid uuid)
-
accept
@Implementation protected android.bluetooth.BluetoothSocket accept(int timeout) throws java.io.IOExceptionMay block the current thread and wait untilBluetoothDeviceis offered viadeviceConnected(BluetoothDevice)method or timeout occurred.- Returns:
- socket of the connected bluetooth device
- Throws:
java.io.IOException- if socket has been closed, thread interrupted while waiting or timeout has occurred.
-
close
@Implementation protected void close() throws java.io.IOException- Throws:
java.io.IOException
-
deviceConnected
public android.bluetooth.BluetoothSocket deviceConnected(android.bluetooth.BluetoothDevice device)
CreatesBluetoothSocketfor the given device and makes this socket available immediately in theaccept(int)method.
-
-