In a native call, I'm trying to open("/dev/video4", O_RDWR)
but I get errno EACCES 13 "permission denied".
If I run the same code* in an executable, on the same Android host, as the same UID of the installed app I'm running above, it works fine. (* minor differences like main()
instead of Java_com_test_testOpen()
)
I've tried chmod 666 /dev/video4
and still get EACCES, which is especially strange.
Why does the same code, on the same host, as the same user, give EACCESS when called via JNI, and success when called as standalone executable?
The test device is rooted and running Cyanogenmod 12.1 (API 22) and I'm targeting >= API 21 (5.0 Lollipop) on rooted devices. Thanks for your help.