4

I wrote an application to access USB camera and it works fine in Android 9, but it failed in Android 10. I know that start from Android 9, application needs to grant permission from user on accessing camera as well as USB device in order to access USB camera. I found that in Android 10, application can grant permission in accessing camera, but when try to ask permission to access USB camera by UsbManager.requestPermission(), application received “deny” immediately without any prompt to ask user. Is there any other permissions I needed to ask in Android 10?

5
  • 4
    There is an open issue on Google's Issue Tracker here: issuetracker.google.com/issues/139087809 Oct 11, 2019 at 6:05
  • Thanks, Saurabh. Then we can only wait Google to solve the problem.
    – CM Yau
    Oct 11, 2019 at 10:54
  • Are you using Camera2 API to access your USB Camera? Please clarify.
    – Vidz
    Jun 28, 2020 at 14:03
  • No, we are using USB Manager and low-level ioctl().
    – CM Yau
    Jun 30, 2020 at 1:03
  • 1
    This is an actual bug currently being tracked here: issuetracker.google.com/issues/145082934 rather than the link above. It has been fixed in >= android-10.0.0_30 but some devices haven't gotten the update.
    – Sinapse
    Jul 17, 2020 at 5:23

1 Answer 1

3

You can try to change the targetversion to 27, but this is not a good solution. Targetversion will be judged before checking permissions,

4
  • But now is the only solution.Otherwise, you have to wait for Google updates
    – Xeon
    Dec 3, 2019 at 7:17
  • Thanks Xeon but this is not a solution because Target SDK should be at least 28 in order to upload to Google Play.
    – CM Yau
    Dec 4, 2019 at 0:14
  • @Dhruv If it is the only solution then a bad solution is still better than no solution. We have a product which makes use of UVC - for now we are building a separate version of the app with targetversion 27 which we are offering for download directly from our website. Not a good solution yes - but at least it allows our customers to still use the product on Android 10!
    – HPage
    Jul 9, 2020 at 6:37
  • 1
    @Dhruv I have to disagree with you. At least this is a solution. Camera's App developers still need to be able to access usb camera no matter what, or they would go out of business. It seems also a very basic requirement, not sure how google broke this...
    – Sinapse
    Jul 17, 2020 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.