Android-telephony File explanation

Source: Internet
Author: User
Tags number strings

1 frameworks/base/telephony/Java/Android/telephony/CDMA provides APIs for using the specific telephone functions of CDMA.
1.1) cdmacelllocation is the direct derived class of celllocation, indicating the location of a CDMA mobile phone call.
Code Division Multiple Access, also known as code division multiple access, is a technology used in wireless communication. CDMA allows all users to use all the frequencies at the same time (1.2288 MHz ), in addition, the signal sent by other users is considered as a noise, and the problem of collision does not need to be taken into account. The advantages of CDMA include: the voice encoding technology provided in CDMA, which has better call quality than the current GSM, and can reduce the noise of the surrounding environment during user conversation to make the call clearer.

2 frameworks/base/telephony/Java/Android/telephony/GSM is an API provided by GSM for specific phone functions, such as text, numbers, and PDU text messages.
2.1) gsmcelllocation is the direct derived class of celllocation, indicating the location of a gsm phone call.
The full name of GSM is: Global System for Mobile Communications. The Chinese language is the global mobile communication system, also known as "global communication". It is a European mobile communication technology standard and the second generation of mobile communication technology, the development goal is to allow users to use a mobile phone network standard across the world, so that users can use a mobile phone all over the world. Currently, China Mobile and China Unicom each have a GSM network, which is the world's largest mobile communication network. Including GSM 900: 900 MHz, GSM 1800: 1800 MHz, and GSM 1900: 1900mhz.
2.2) smsmanager manages SMS operations, such as sending data, text messages, and PDUS. Call the static method smsmanager. getdefault () to obtain this object. Replaced by Android. telephony. smsmanager that supports both GSM and CDMA.
2.3) smsmessage: a short message service. Replaced by Android. telephony. smsmessage that supports both GSM and CDMA.

3 frameworks/base/telephony/Java/Android/telephony provides APIs (application programming interfaces) for basic mobile phone information ), it includes the network type, connection status, and telephone number string processing utility.
3.1) celllocation indicates the abstract class of the device location. There are two Derived classes: cdmacelllocation and gsmcelllocation.
3.2) The format of the Japanese phone number is complicated.
3.3) neighboringcellinfo implements the parcelable interface, which indicates the phone information adjacent to the Code, including the signal acceptance intensity and phone ID location.
3.4) phonenumberformattingtextwatcher implements the textwatcher interface to detect a text input box. If a phone number is entered, it is formatted using the formatnumber function of phonenumberutils. This format is based on the current system. In the future, object creation and language environment transformation will not affect this instance.
3.5) phonenumberutils various utilities that process phone number strings.
3.6) phonestatelistener is a listener that monitors changes in the status of a specific phone on a device, including service status, signal strength, and Message Waiting indication (VOICEMAIL. Method rewriting is performed on the status to accept updates. And use your phonestatelistener object to bitwise or with the listen _ flag. Access to some phone information is protected by permissions. Your application will not receive protection information updates unless it declares that it has the appropriate permissions in the manifest file. Any application for permission will have the appropriate listen _ mark.
3.7) servicestate implements the parcelable interface, including telephone status and service-related information. The following telephone information is contained in the returned servicestate:
Service Status: in_service, out_of_service, emergency_only, power_off
Roaming indicator
Operation name, short name, and number
Network selection mode
3.8) signalstrength implements the parcelable interface, which contains information about the signal strength of the mobile phone.
3.9) smsmanager manages SMS operations, such as sending data, text messages, and PDUS. Call the static method smsmanager. getdefault.
3.10) smsmessage: a short message service.
3.11) telephonymanager is used to access information about telephone services on devices. Applications can use this class to determine the telephone service and status and access some types of user information. The application can also register a listener to receive notifications of phone status changes. Instead of directly instantiating this class, you retrieve an instance through the getsystemservice method of Android. content. context. Note that some phone information accessed is protected by permissions. Your application will not receive protection information updates unless it declares that it has the appropriate permissions in the manifest file. Any license application will be recorded in your access to protected information. Two services are used to access the Telephony function:
Itelephony provides interfaces for operations and interaction with telephony, which are implemented by phoneinterfacemanager. Java in packages/apps/phone.
Itelephonyregistry provides interfaces for registering telephony events. Implemented by frameworks/base/services/Java/COM/Android/Server/telephonyregistry. java.

4 frameworks/base/telephony/Java/COM/Android/Internal/telephony/CDMA/
4.1) cdmacall is the direct derived class of call.
4.2) CDMA connection is the direct derived class of connection.
4.3) cdmaphone is the direct derived class of phonebase.

5 frameworks/base/telephony/Java/COM/Android/Internal/telephony/GSM/
5.1) gsmcall is the direct derived class of call. It is used to connect to the mobile phone during the call.
5.2) gsmconnection is the direct derived class of connection.
5.3) gsmphone is the direct derived class of phonebase.

6 frameworks/base/telephony/Java/COM/Android/Internal/Telephony
6.1) adnrecord implements the parcelable interface to load and store the scaling dial numbers.
6.2) basecommands implements the commandsinterface interface to handle telephone events (send a message to the corresponding handler ).
6.3) Get the first and last call, as well as the creation time and connection time of the first call. There are two Derived classes: cdmacall and gsmcall.
Public Enum state {
Idle, active, holding, dialing, alerting, incoming, waiting, disconnected, disconnecting;
Public Boolean isalive (){
Return! (This = idle | this = disconnected | this = disconnecting );
}
Public Boolean isringing (){
Return this = incoming | this = waiting;
}
Public Boolean isdialing (){
Return this = dialing | this = alerting;
}
}
6.4) callerinfo is used by the phone number to view the information of the caller.
6.5) callerinfoasyncquery: asynchronous query.
6.6) commandsinterface describes all telephone operation interfaces, such as commands, query status, and telephone event listening. Implemented by basecommands.
6.7) connection processes some data in the connection process. There are two Derived classes: CDMA connection and gsmconnection.
Public Enum disconnectcause {
Not_disconnected,/* has not yet disconnected */
Incoming_missed,/* an incoming call that was missed and never answered */
Normal,/* normal; remote */
Local,/* normal; Local hangup */
Busy,/* outgoing call to busy line */
Congestion,/* outgoing call to Congested Network */
MMI,/* not presently used; dial () returns NULL */
Invalid_number,/* invalid dial string */
Lost_signal,
Limit_exceeded,/* eg gsm acm limit exceeded */
Incoming_rejected,/* an incoming call that was rejected */
Power_off,/* radio is turned off explicitly */
Out_of_service,/* Out of service */
Icc_error,/* No ICC, ICC locked, or other ICC Error */
Call_barred,/* Call was blocked by call barrring */
Fdn_blocked,/* Call was blocked by fixed dial number */
Cs_restricted,/* Call was blocked by restricted all voice access */
Cs_restricted_normal,/* Call was blocked by restricted normal voice access */
Cs_restricted_emergency,/* Call was blocked by restricted emergency voice access */
Unobtainable_number,/* unassigned number (3GPP ts 24.008 table 10.5.123 )*/
Imsi_unknown_in_vlr,/* imsi is not known at the vlr */
Imei_not_accepted,/* network does not accept emergency call establishment using an IMEI */
CDMA _locked_until_power_cycle,/* MS is locked until next power cycle */
CDMA _drop,
CDMA _intercept,/* intercept order received, MS state idle entered */
CDMA _reorder,/* MS has been redirected, call is canceled */
CDMA _so_reject,/* Service option rejection */
CDMA _retry_order,/* requeseted service is rejected, retry delay is set */
CDMA _access_failure,
CDMA _preempted,
CDMA _not_emergency,/* not an emergency call */
CDMA _access_blocked,/* Access blocked by CDMA network */
Error_unspecified
}
6.8) defaultphonenotifier implements the phonenotifier interface. In its method implementation, call service itelephonyregistry to publish a telephone event.
6.9) icccard refers to the SIM card or UIM card.
6.10) Service itelephonyregistey is implemented by frameworks/base/services/Java/COM/Android/Server/telephonyregistry. java. This class triggers the corresponding broadcast receiver by broadcasting intent.
6.11) Phone describes all the telephone operation interfaces. the SDK developer cannot obtain this interface. This interface is implemented through phonebase and phoneproxy.
Enum state {
Idle,/no call no phone activity */
Ringing,/* calls (including new calls when there is no call or when there is a call) a phone call is ringing or call waiting. in the latter case, another call is active as well */
Offhook;/* The phone is off Hook. At least one call exists that is dialing, active or holding and no callare ringing or waiting .*/
};
Enum datastate {
Connected,/* IP traffic shocould be available */
Connecting,/* Data Connection in progress currently setting up data connection */
Disconnected,/* No data signal IP not available */
Suincluded;/* The data connection is created, but some connections are unavailable. For example, a voice call is used in a 2G network. Connection is created but IP traffic is temperately not available. I. e. Voice call is in place in 2G Network */
};
Public Enum dataactivitystate {
None,/* No data traffic no traffic */
DataIn,/* receive data using ip ppp Traffic (Public-Private Partnership <PPP, public-private partnership> is a funding model for public infrastructure projects such as <new telecom systems, airports, and power plants>. PPP can handle error detection, support multiple protocols, allow IP address negotiation at connection time, and allow identity authentication. Suitable for modem, HDLC bit sequence line, SONET, and other physical layers. It supports error detection, Option Negotiation, header compression, and reliable transmission using the HDLC frame format <optional> .) */
Dataout,/* send data sending ip ppp traffic */
Datainandout,/* receive and send data simultaneously both processing ing and sending ip ppp traffic */
Dormant;/* data connection is available, but the physical connection is disconnected from the data connection is still active, but physical link is down */};
Enum suppservice {
Unknown, switch, separate, transfer, conference, reject, hangup;
};
The full name of APN is Access Point name, and the full name is access point. It is a parameter that must be configured when you access the Internet through a mobile phone, it determines which access method your mobile phone uses to access the network.
6.12) phonebase implements the phone interface and the basic implementation of the phone. Phone. Java is expected to implement it from a single application thread, and the same thread will obtain the interface from phonefactory. There are two Derived classes: cdmaphone and gsmphone.
6.13) phonenotifier defines the notification method for telephone events. Defaultphonenotifier is used to implement this interface.
6.14) phoneproxy implements the phone interface and implements all phone functions. You can use phoneproxy when you do not need to distinguish between CDMA phone and GSM phone.
6.15) RIL inherits the basecommands class and implements the interface methods in commandsinterface.
Rilrequest represents a telephone service command request. rilsender is responsible for sending commands. rilsener users listen to sockets to process command responses and actively report information.
RIL communicates with the rild daemon through socket. RIL converts an abstract interface into a specific function implementation that encapsulates telephone service commands, such as acceptcall or dial, and converts it into a corresponding ril_request_xxx and sends it to rild.
Standard command sending process: rilrequest. Obtain (ril_request_xxx, result) --> copy parameter --> send event_send --> rilsender process event_send --> write ril_request_xxx to out stream (socket ). Rilreceiver creates a socket in run.
Standard Response and active reporting processes: rilreceiver listens for socket input --> readrilmessage reads complete response --> processresponse processes response_unsolicited (Active Reporting) and response_solicited (command response) respectively ).
Send and processresponse are asynchronous, that is, the sending and response of telephone service commands are asynchronous.
The upper layer encapsulates RIL through gsmphone and provides most of the functions implemented by rIL through the phone interface. In the phone application, use phonefactory. makedefadefaphonesphonefactory. usenewrilphonefactory. registerphone to obtain the gsmphone instance.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.