android telephony stack

8

Click here to load reader

Upload: david-marques

Post on 01-Sep-2014

15.575 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Android telephony stack

   

RIL

GSMPhone

RILSender RILReceiver

RILD

Proprietary RIL library

libril

1

2

3

4

6

8

9

10

5 6

7

Android Telephony 

StackJava API

Native API

© David Marques ­ [email protected]

Page 2: Android telephony stack

   

RIL

GSMPhone

1 10

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  top­down  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.

Page 3: Android telephony stack

   

RIL

RILSender RILReceiver2

9

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. 

Page 4: Android telephony stack

   

RILSender RILReceiver

RILD

3 8

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. 

Page 5: Android telephony stack

   

RILD

Proprietary RIL library

libril

4

65 6

7

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.

Page 6: Android telephony stack

RILDRIL

libril

proprietary ril

Solicited command flow: android RIL -> 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;

Page 7: Android telephony stack

RILDRIL

libril

proprietary ril

Solicited command flow: proprietary RIL -> android 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;

Page 8: Android telephony stack

Note: All  the  information  in  this document comes from  the  Android  2.2  release  (aka  Froyo)  of  the Android  open­source  project.  Any  future  updates may  invalidate  the  information  contained  on  this document.