Class ConnectionManager
java.lang.Object
com.yubico.yubikit.android.transport.usb.connection.ConnectionManager
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionManager
(android.hardware.usb.UsbManager usbManager, android.hardware.usb.UsbDevice usbDevice) -
Method Summary
Modifier and TypeMethodDescription<T extends com.yubico.yubikit.core.YubiKeyConnection>
TopenConnection
(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
(Class<T> connectionClass, ConnectionHandler<? extends T> handler) Registers a new ConnectionHandler for creating YubiKeyConnections.boolean
supportsConnection
(Class<? extends com.yubico.yubikit.core.YubiKeyConnection> connectionType) Checks to see if a given connection type is supported
-
Constructor Details
-
ConnectionManager
public ConnectionManager(android.hardware.usb.UsbManager usbManager, android.hardware.usb.UsbDevice usbDevice)
-
-
Method Details
-
registerConnectionHandler
public static <T extends com.yubico.yubikit.core.YubiKeyConnection> void registerConnectionHandler(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(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(Class<T> connectionType) throws IOException TODO: 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:
IOException
-