Class UsbPermissionHandler
java.lang.Object
com.flir.thermalsdk.androidsdk.live.connectivity.UsbPermissionHandler
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceUsbPermission callback, provide information if access to usb devices e.g FLIR ONE is allowed by the user -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasFlirOnePermission(@Nullable Identity identity, @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 truestatic booleanCheck if it's a real FLIR ONE, emulators will return FALSEvoidrequestFlirOnePermisson(Identity identity, android.content.Context uiContext, UsbPermissionHandler.UsbPermissionListener usbPermissionListener) Request permission to connected to the given FLIR ONE device.
-
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
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)
-