The androidinternaltelephonygsm Package

Many of the classes and interfaces in the previous section are typical of a Java API that can have multiple implementations. The implementations of the API defined in the telephony.internal package correspond to a library used in the RIL. To better understand this API, we will look at one implementation here that supports GSM.

Thus, this section delves further into the telephony internals of Android, looking especially at how the interfaces and abstract base classes are implemented and subclassed to enable access to the functionality of GSM telephony. Although it may seem that specifications such as TS 27.007 cover mobile telephony in general, this layer of Android actually has to accommodate variations in mobile telephony standards. In CDMA telephony, for instance, the SIM card is an optional part of the standard and is rarely present in CDMA handsets. In this case, the package described in this section would be replaced by a CDMA-oriented package with a similar architectural relationship to the higher-level classes described in the previous section. The RIL code is also specific to the type of telephony in the handset.

At the RIL layer, the differences between GSM and CDMA are mainly outside the core functionality of making phone calls, so you may be wondering why all these layers and APIs are necessary. But, as the description of the classes specific to communicating with a GSM RIL will show, there are plenty of differences in detail, such as SIM cards, the type of mobile data network, etc. These make it impractical to design a universal interface to mobile radios, despite the use of a standard protocol for communicating with them:


This class is used to load and store Abbreviated Dialing Numbers (ADNs) to and from the SIM card. ADNs are short numbers used for information calls, emergency calls, etc. AdnRecordCache

This class caches and enables access to ADNs.


This class holds data specifying the access point name (APN) and other parameters for connecting to General Packet Radio Service (GPRS) and 3G mobile data networks. This mobile data technology is specific to GSM networks. BaseCommands

This class implements the CommandsInterface interface, which is used throughout the GSM telephony classes to communicate with the GSM radio.


This interface defines constants for decoding failure cause codes. CallForwardInfo

This class holds data that corresponds to the parameters of a call-forwarding command to the RIL.


This class maps information from the RIL to state transitions for the GSMCall class. CommandException

This class is an exception thrown when the RIL reports an error from a command. CommandsInterface

This interface defines the API to the GSM RIL. This interface is implemented by the BaseCommands class. DataConnectionTracker

This tracks the state of GPRS packet data protocol (PDP) connections. This type of connection is specific to GSM mobile data.


This class implements the DataLinkInterface interface and is used in the PPPLink class, which manages point to point protocol (PPP) links in GPRS networking. DataLinkInterface

This class defines the API for connecting and disconnecting PPP links.


This class parses information, in AT command syntax, from the mobile radio, and turns it into call state information. EncodeException

This class is an exception thrown by methods of the GSM alphabet class, which encodes UTF-16 (as used in Java) into the 7-bit SMS character set.


This class is a utility class containing static methods for encoding UTF-16 to the 7-bit SMS character set. GSMCall

This class extends the Call class, and implements the abstract methods of that class, thereby implementing parts of the Android telephony internals API. This class models calls in GSM telephony.


This class extends the Connection class, and like the GSMCall class, implements the abstract methods of the Connection class. This class models connections in GSM telephony. GSMPhone

This class extends the Phone class and, as with both the GSMCall and GSMConnection classes, implements the abstract methods of the Phone class.


This class implements the MmiCode interface and the part of the telephony API defined in that interface. GsmSimCard

This class implements the SimCard interface, another part of the implementation of the telephony internals API. This class enables access to data in the SIM card.


This interface defines an API for accessing ADN records stored in the SIM card.


This interface defines the API for sending SMS messages. MccTable

This class is a utility class that contains a table of Mobile Country Codes (MCCs). In principle, these codes are not specific to a GSM RIL, but they are specific to this implementation of a GSM RIL. NetworkInfo

This class is a container for network state information. PDPContextState

This contains data about a PDP session, including the IP address. PdpConnection

This class contains information about the data connection associated with a PDP context.


This class extends DataLink and implements DataLinkInterface to provide an implementation of this part of the RIL interface.

This class extends the BaseCommands class and also implements the CommandsInterface interface, forming a complete implementation of the interface for sending commands to the RIL. This is where communication with the RIL takes place. An instance of the RIL class is created in the PhoneFactory class, in the course of creating an instance of the GSMPhone class.


This interface defines constants used in the RIL class.


This class polls the RIL daemon for signal strength and tracks other aspects of the state of mobile service. SIMFileHandler

This enables access to the SIM filesystem.


This class enables access to specific files in the SIM filesystem containing information such as the subscriber's IMSI. SimConstants

This interface contains constants used in other classes accessing data in the SIM. SimException

This class extends Exception and is used in other classes to throw an exception related to errors accessing data in the SIM. SimFileNotFound

This class extends SimException and is used in the SimIoResult class in specific error conditions.


This class extends ISimPhoneBook and provides a service interface for accessing ADN records in the SIM. SimProvider

This class extends ContentProvider and creates a content provider interface to SIM ADN/SDN/FDN records in the SIM.


This class extends ISms and creates a service interface for accessing SMS messages stored in the SIM. SimTlv

This class is an object interface for accessing tag-length-value records in the SIM, and is used in the SIMRecords class.


This class contains static utility methods for manipulating data encoded in binary-coded decimal and other encodings encountered in SIM data. SMSDispatcher

This class implements the sending of SMS messages and notifies applications that use the Handler interface to this class regarding the status of SMS messages.


This class contains constants and methods for decoding SMS headers. SmsRawData

This class implements Parcelable and is used in implementing service interfaces for accessing SIM data.


This class associates a message reference with an acknowledgment.


This class contains constants for decoding information about supplementary services.


This class parses information in the etc/voicemail-conf.xml file.

There is another package organized hierarchically under the internal.telephony.gsm package: the stk package, which contains classes for accessing the SIM. This package is not exposed outside the internal.telephony.gsm package and is beyond the scope of this chapter.

0 0

Post a comment