I'm actually working on a project where I need to connect an OAK-1 camera to an Android device.
To be able to use the camera through an Android app the user must explicitly validate a permission popup at each launch.
My problem is that to make this application usable in production, I will need the permissions to be accepted only once on the first use and never asked again.
This goal is normally achievable using intent-filter, like as shown here
But from what I understand the particularity of the OAK is that it 's composed of "two devices" .
When the camera is connected it is first recognized as Movidus Myradix with a productId equal to 9349 (info from UsbHostManager).
At this point a first permission popup appears for this device (so far no problem).
But when on the C++ side the
dai::Device object is created the camera turns on and the UsbHostManager recognizes it as Luxonis Device with a product id equal to 63035
So a new permisssion request must be made because it appears as a different device.
But at this point the dephtai-core API seems to have trouble to detect the "second" device correctly. The program seems to loop in
getAnyAvailableDevice and no permission request appears.
Then after a few seconds the app crashes with a beautiful
std::runtime_error("No available devices") and a significant number of permission popups appear, as if previously the loop that handles the detection of the device had tried to send multiple permission requests.
I wonder if other people have camera permission problems on Android and have found a way to solve them ?
The problem appears even on a simple project since I tried the above mentioned intent solution on this project and the result is the same.
It seems that using intent-filter to automatically get permission for a usb device on Android conflicts with the permission requests made by the
If someone with a better understanding of the
depthai-core lib and its dependencies can tell me where I can find the code that performs the permission request i'm interested 🙂
I will try to bring more information as I explore the problem.