Is USB debugging turned on? That might have something to do with it since you claim you have granted all permissions.
On Wed, May 16, 2018, 06:22 Siroj Rahmatxo'jayev <[email protected]> wrote: > I am trying to connect external barcode scanner (HID) to the Android > application which is in Kiosk mode(Android COSU). A system dialog should be > displayed to ask for the permissions in order to access the barcode from > usb. However, In kiosk mode, when startLockTask() turn on, permission > dialog not shown. When I try use it, I bring Security exception... > For resolve I grand all runtime permissions progmaticaly with > DevicePolicyManager.setPermissionGrantState and > DevicePolicyManager.setPermissionPolicy(adminComponentName,PERMISSION_POLICY_AUTO_GRANT);. > It work for all runtime permissions but not work for usb permission. > Please, help me with this issue. > > -- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/android-developers. > To view this discussion on the web visit > https://groups.google.com/d/msgid/android-developers/adc0b5f1-faa3-44ac-8f21-d3d214f86cfc%40googlegroups.com > <https://groups.google.com/d/msgid/android-developers/adc0b5f1-faa3-44ac-8f21-d3d214f86cfc%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/CAGvJgdJyRUrM9KZS9csmHdyjzUKchEFjbOKwLUNJcedr-LnRaQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

