1. The document describes the architecture and communication flow for making requests to the radio interface layer (RIL) in Android.
2. It involves classes like GSMPhone, RIL, RILSender, RILReceiver, and the RILD native process which communicates with the proprietary radio interface library.
3. Requests are sent via asynchronous calls from the phone implementation to RIL, then from RIL to the RILD process which calls the proprietary radio library, and responses return through the same layers back to the original caller.
2. GSMPhone
1 10
RIL
The com.android.internal.telephony.gsm.GSMPhone class implements a GSM phone and
exposes all phone capabilities to the other components inside the android framework. This
class interfaces with the radio interface layer in order to communicate to the baseband radio
modem though the com.android.internal.telephony.RIL class. The topdown communication
between these layers is done by asynchronous function calls passing an android.os.Message
instance to be used in order to send the response back to the function caller with the function
result within the message itself.
3. RIL
9
2
RILSender RILReceiver
The com.android.internal.telephony.RIL class has two internal classes responsible for
sending the requests and receiving the responses to and from the RIL daemon respectively.
Both RILSender and RILReceiver classes run on its own threads interacting with the RIL
daemon through a linux socket to send and receive messages to the baseband radio.
4. RILSender RILReceiver
3 8
RILD
The RIL daemon (RILD) is a native linux process that communicates with the Java telephony
API through a linux socket exposing a radio implementation agnostic protocol.
5. RILD
4 7
libril
6
5 6
Proprietary RIL library
The RIL daemon (RILD) loads the proprietary RIL library and registers its radio specific
functions implementation into the telephony stack. The RILD receives requests through a
linux socket and processes the request calling the proprietary library's radio function
implementation passing the appropriate parameters. The proprietary library returns a
response to the telephony stack through a callback function which marshals the response
and sends it back to the Java API though the same socket used to receive the request. The
Java layers processes the request on the RILReceiver class and forwards the response to
the original request owner.
6. Solicited command flow: android RIL -> proprietary RIL
R RILD
I libril
L
proprietary ril
1. Phone implementation calls RIL class to communicate with the baseband radio;
2. RIL class creates a Parcel and fills its content with the specified parameters;
3. RIL marshals the parcel into raw data and sends through the RILD socket;
4. RILD unmarshals the raw data into a Parcel and extracts the request parameters from the
Parcel;
5. RILD calls through libril the proprietary RIL library request handler function passing the
extracted parameters;
7. Solicited command flow: proprietary RIL -> android RIL
R RILD
I libril
L
proprietary ril
1. Proprietary RIL library calls the response function on the android libril passing the result;
2. Android libril creates a Parcel, puts the result within it and marshals the Parcel into raw
data to be sent through the RILD socket back to the Java layer;
3. At the Java layer the raw data that came from the socket is unmarshaled into a Parcel
and the result is extracted and sent to the original request owner;
4. The request owner receives the response on a Message instance passed to the RIL class
method called to make the request;
8. Note: All the information in this document comes
from the Android 2.2 release (aka Froyo) of the
Android opensource project. Any future updates
may invalidate the information contained on this
document.