How to disable RIL on Android? As soon as I connect a USB modem to android device, system grabs ttyACM0 and ttyACM1 in an attempt to open connection. As a result, the ports are blocked and can not be opened by other services. How, if possible, can I disable RIL on android to avoid having it block ttyACM0 and ttyACM1 as soon as modem is plugged in? Is it doable without having to rebuild Android?

I have tried making following changes in init.rc, as well as deleting ril-deamon service entry.

setprop ro.radio.noril yes
setprop hw.nophone true
The consequences of disabling the RIL daemon (rild) is hardware dependent. Because RIL is getting more and more involved in all aspects of Radio related items, including WiFi. The easiest way to stop RIL is by killing rild. But you need to have a rooted device to do this. Open a command shell and get root prompt (#). 

# kill -9 `pidof rild`


You can then check the current status with:

# getprop |grep init.svc.ril
...
[init.svc.ril-daemon]: [stopped]
[init.svc.ril-qmi]: [stopped]


To restart rild you have to point it to the right device and library files. You can find what these are with:

# getprop | grep rild.lib
...
[rild.libargs]: [-d /dev/smd0]
[rild.libpath]: [/system/lib/libril-qc-qmi-1.so]


Then restart with*:

# rild -l /system/lib/libril-qc-qmi-1.so -- -d /dev/smd0 


* PS. I haven't actually tried this line, so feel free to edit this post. It's possible you also need to supply the correct SE context to SU as well...