Professional Documents
Culture Documents
1 10
RIL
9
Android
2
RILSender RILReceiver Telephony
3 8
Java API
Stack
RILD
Native API
4 7
libril
6
5 6
Proprietary RIL library
© David Marques dpsmarques@gmail.com
GSMPhone
1 10
RIL
RIL
9
2
RILSender RILReceiver
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.
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.
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;
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;
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.