Class ConnectionManager

java.lang.Object
com.yubico.yubikit.android.transport.usb.connection.ConnectionManager

public class ConnectionManager extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConnectionManager(android.hardware.usb.UsbManager usbManager, android.hardware.usb.UsbDevice usbDevice)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends com.yubico.yubikit.core.YubiKeyConnection>
    T
    openConnection(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>
    void
    registerConnectionHandler(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 handler
      handler - 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