问题
I am trying to connect external GSM modem with nexus 5 and send AT command using android RIL layer.I am using android 5.0 AOSP for nexus 5 downloaded from Google source.
Error: Permission denied with trying to open ttyACM0 port. i have checked this by changing permissions but still permission denied error.
Does there any other permissions do i have to change to open port?
回答1:
You are getting permission denied because the Android RIL doesn't have the appropriate selinux(Security Enhanced Linux) permissions for that device. As the RIL already has rw permissions to the files in the radio_device context as shown below and in this link.
allow rild radio_device:chr_file rw_file_perms;
So, just change the context of your device file to radio_device
so that the RIL has the appropriate permissions to access it by adding the line below to file YOUR_BUILD_DIRECTORY/external/sepolicy/file_context
and hopefully it should work.
/dev/ttyACM0 u:object_r:radio_device:s0
来源:https://stackoverflow.com/questions/29844577/permission-denied-for-ttyacm0-port-in-nexus-5