Class UsbPermissionHandler

java.lang.Object
com.flir.thermalsdk.androidsdk.live.connectivity.UsbPermissionHandler

public class UsbPermissionHandler extends Object
Helper class to perform runtime permission requests for accessing USB devices as FLIR ONE devices

If a intent filter that listen for connected USB devices is specified in the Android Manifest AND the user is granting these permissions you do not have to ask for runtime permission and don't need to use this class.

  • Constructor Details

    • UsbPermissionHandler

      public UsbPermissionHandler()
  • Method Details

    • requestFlirOnePermisson

      public void requestFlirOnePermisson(@NonNull Identity identity, @NonNull android.content.Context uiContext, @NonNull UsbPermissionHandler.UsbPermissionListener usbPermissionListener)
      Request permission to connected to the given FLIR ONE device. Will show a dialog prompting the user to allow access if permission is missing NB if your application uses USB permission in the Android Manifest all access is automatically permitted and you don't need to use this functionality
      Parameters:
      identity - the identity for which permission should be requested.
    • hasFlirOnePermission

      public static boolean hasFlirOnePermission(@Nullable @Nullable Identity identity, @Nullable @Nullable android.content.Context applicationContext)
      Verify that the application has permission to access the USB device e.g a FLIR ONE A FLIR ONE emulator identity will return true
      Returns:
      true if permission was valid else false
    • isFlirOne

      public static boolean isFlirOne(@Nullable @Nullable Identity identity)
      Check if it's a real FLIR ONE, emulators will return FALSE
      Returns:
      IFF it's a real FLIR ONE all other identifies will return FALSE (incl FLIR ONE emulators)