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
-
4There is an open issue on Google's Issue Tracker here: issuetracker.google.com/issues/139087809– Saurabh ThoratOct 11, 2019 at 6:05
-
Thanks, Saurabh. Then we can only wait Google to solve the problem.– CM YauOct 11, 2019 at 10:54
-
Are you using Camera2 API to access your USB Camera? Please clarify.– VidzJun 28, 2020 at 14:03
-
No, we are using USB Manager and low-level ioctl().– CM YauJun 30, 2020 at 1:03
-
1This 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.– SinapseJul 17, 2020 at 5:23
Add a comment
|
1 Answer
You can try to change the targetversion to 27, but this is not a good solution. Targetversion will be judged before checking permissions,
-
But now is the only solution.Otherwise, you have to wait for Google updates– XeonDec 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 YauDec 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!– HPageJul 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...– SinapseJul 17, 2020 at 5:14