Since Android 6 was introduced, apps might require various run time(dynamic) permission in order to allow different features. Currently B4A has Run Time permission, which allow app to ask user for run time permission, for example:
We used this dynamic runtime permission, but Today we found out that USB Permission Dialog is not appear in Android 10. And since Usb permission is "called" from usbmanager, not from permission, I can't use runtimepermission library for that purpose (for example rp.hardware.usb.action.USB_DEVICE_ATTACHED is not a valid statement). And I need solution with runtime permission - I already use solutions like this for older Android versions:
We also, already use Usb filter in manifest, but since Android 10 Android USB Permission dialog, is not appearing anymore (we haven't tested Android 9, the dialog works until Android 8.1, and doesn't work with Android 10). Example from Manifest:
AddPermission(android.hardware.usb.action.USB_DEVICE_DETACHED)
AddPermission(android.hardware.usb.action.USB_DEVICE_ATTACHED)
Help will be appreciated, please, note it is about Android 10 Runtime permission (usb serial dialog) and NOT permissions, defined in the manifest.
Code:
rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
We used this dynamic runtime permission, but Today we found out that USB Permission Dialog is not appear in Android 10. And since Usb permission is "called" from usbmanager, not from permission, I can't use runtimepermission library for that purpose (for example rp.hardware.usb.action.USB_DEVICE_ATTACHED is not a valid statement). And I need solution with runtime permission - I already use solutions like this for older Android versions:
USB to Serial Permission
I've got a Prolific USB to Serial device. I've tried the felUsbSerial library and it works with it. I understand that as per many things with Android the user needs to give permission for the app to access it. That is fine when running it the first time. But it seems that after a reboot you...www.b4x.com
We also, already use Usb filter in manifest, but since Android 10 Android USB Permission dialog, is not appearing anymore (we haven't tested Android 9, the dialog works until Android 8.1, and doesn't work with Android 10). Example from Manifest:
AddPermission(android.hardware.usb.action.USB_DEVICE_DETACHED)
AddPermission(android.hardware.usb.action.USB_DEVICE_ATTACHED)
B4X:
CreateResource(xml, device_filter.xml,
<resources>
<usb-device />
</resources>
)
AddApplicationText(
<activity android:name=".main" >
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/device_filter" />
</activity>
)
Help will be appreciated, please, note it is about Android 10 Runtime permission (usb serial dialog) and NOT permissions, defined in the manifest.