I am developing an application for a custom tablet (built as a sales tool by my company) running Android. The application needs to communicate over a virtual serial port to an attached USB device. The drivers are installed and work great (it is a CP2101 USB to UART Bridge Controller by Silicon labs). I am using the serial port library found at: http://code.google.com/p/android-serialport-api/.
The problem is whenever the device is mounted I do not have permission to open it in Android. The Android serial port library expects to open a file, which is usually /dev/ttyUSB0, but the application does not have permission to do so. If I open the adb shell and run "chmod 666 /dev/ttyUSB0" everything works great. Of course I need a more permanent solution.
I don't think init.rc will work because I want to be able to modify the device file whenever it is mounted, not just at boot. Is there a way to force Linux to mount this device (or any device really) with more lenient permissions?
Thanks in advance.
Check /ueventd.rc
. There are configured device permissions and owners/groups.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With