Hi Puneet, I noticed on my device that most of the device files have the following permissions enabled
crw-rw-rw- You might want to change your current driver code and set this permissions correctly instead of changing it via script. The problem with changing the permissions via script is that you execute the script only during bootup. You might have to add a daemon process which acts on whether the device is available or not (how do you handle cases where the driver is removed with a rmmod and is added again) and then execute the script. Why not changing the driver right away with the correct permissions? -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 4, 2:49 pm, Puneet <puneetjindal.1...@gmail.com> wrote: > Hi everybody, > > I am trying to run Android on my prototype phone. The phone has a > sensor (a device that reports its orientation to the phone) attached > to it through the USB interface. > > I have developed a hardware module for that sensor, the name of the > shared library for the module being "sensors.default.so". The module > communicates with the sensor through the device file /dev/ttyUSB0. > > The problem I am facing is that the device file /dev/ttyUSB0 has > permissions as: > crw------- root root 188, 0 > 1980-01-10 18:47 ttyUSB0 > > So, when I test the module's functionality by running a test android > application, the application doesn't have enough privileges to read/ > write from/to the device file. So, the results are negative. > > And, if I test the same functionality by running a native test > application (via the adb shell, so it runs as root), the results are > positive. > > I tried to solve this issue by modifying the startup scripts (these > run as root) to change the device file permissions at startup, but it > seems that the device file is created after the scripts have completed > their execution. > > Any suggestions on what should be done, to make the android > application able to read/write from/to the device file ? > How to change the device file permissions at the time of creation ? > > Thanks, > Puneet Jindal --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-framework" group. To post to this group, send email to android-framework@googlegroups.com To unsubscribe from this group, send email to android-framework+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~----------~----~----~----~------~----~------~--~---