Class ConnectionManager
- java.lang.Object
-
- com.yubico.yubikit.android.transport.usb.connection.ConnectionManager
-
public class ConnectionManager extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ConnectionManager(android.hardware.usb.UsbManager usbManager, android.hardware.usb.UsbDevice usbDevice)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends com.yubico.yubikit.core.YubiKeyConnection>
TopenConnection(java.lang.Class<T> connectionType)TODO: fixme Checks if a connection type is supported by the device, attempts to acquire the connection lock, and returns a connection.static <T extends com.yubico.yubikit.core.YubiKeyConnection>
voidregisterConnectionHandler(java.lang.Class<T> connectionClass, ConnectionHandler<? extends T> handler)Registers a new ConnectionHandler for creating YubiKeyConnections.booleansupportsConnection(java.lang.Class<? extends com.yubico.yubikit.core.YubiKeyConnection> connectionType)Checks to see if a given connection type is supported
-
-
-
Method Detail
-
registerConnectionHandler
public static <T extends com.yubico.yubikit.core.YubiKeyConnection> void registerConnectionHandler(java.lang.Class<T> connectionClass, ConnectionHandler<? extends T> handler)Registers a new ConnectionHandler for creating YubiKeyConnections.- Type Parameters:
T- the type of connection created by the handler- Parameters:
connectionClass- the type of connection created by the handlerhandler- the handler responsible for creating connections
-
supportsConnection
public boolean supportsConnection(java.lang.Class<? extends com.yubico.yubikit.core.YubiKeyConnection> connectionType)
Checks to see if a given connection type is supported- Parameters:
connectionType- the type of connection to check support for- Returns:
- true if the connection type is supported
-
openConnection
@WorkerThread public <T extends com.yubico.yubikit.core.YubiKeyConnection> T openConnection(java.lang.Class<T> connectionType) throws java.io.IOExceptionTODO: fixme Checks if a connection type is supported by the device, attempts to acquire the connection lock, and returns a connection.- Type Parameters:
T- the type of connection to open- Parameters:
connectionType- the type of connection to open- Throws:
java.io.IOException
-
-