I have configured v4l2 on my android device. I plug the webcam and see that /dev/video4 node is created. But when I try to open it from my JNI layer it says "Permission denied"
I have tried the following
1) Change the permission of /dev/video4 so that it is Read-Write for all (0666)
2) Added the android.permission.camera in the android manifest xml (originally /dev/video4 was created by system and camera group had rw access.)
None of them work. Any ideas on how to solve it?
This sounds like the same issue I had with SE Linux permissions on Lollipop. See my answer here.
In short, you can:
echo 0 > /sys/fs/selinux/enforce
allow untrusted_app video_device:chr_file rw_file_perms;
toexternal/sepolicy/untrusted_app.te
.