Android dial-up Internet access process

Source: Internet
Author: User

Android Network dialing process:

Frameworks \ base \ Services \ Java \ com \ Android \ Server \ connectivityservice. Java
-> [Myhandler-> handlemessage-> case event_set_mobile_data-> handlesetmobiledata]
Frameworks \ base \ Services \ Java \ com \ Android \ Server \ connectivityservice. Java
-> [Mnettrackers [connectivitymanager. type_mobile]. Reconnect ()]
Frameworks/base/CORE/Java/Android/NET/mobiledatastatetracker. Java
Extends networkstatetracker
-> [Reconnect ()]
Frameworks/base/CORE/Java/Android/NET/mobiledatastatetracker. Java
-> [Setenableapn]

.. \ Base \ telephony \ Java \ com \ Android \ internal \ telephony \ itelephony. Java
-> [Enableapntype]
Packages \ apps \ phone \ SRC \ com \ Android \ phone \
Phoneinterfacemanager. Java (extends itelephony. stub) Implementation
-> [Enableapntype-> mphone. enableapntype (type)]
{Where does this mphone come from? Through the source code, we can find that the phoneinterfacemanger constructor is passed in. Create a phoneinterfacemanger object in the oncreate function of phoneapp. Java, phonefactory. makedefaphphones (this );

Phone = phonefactory. getdefaultphone (); that is to say, the phone here is either a cdmaphone instance or a gsm phone instance, because cdmaphone extends phonebase and gsmphone extends phonebase .}
Frameworks \ base \ telephony \ Java \ com \ Android \ internal \ telephony \
Phonebase. Java extends handler implements phone
-> [Enableapntype]
Frameworks \ base \ telephony \ Java \ com \ Android \ internal \ telephony \
Dataconnectiontracker. Java
-> [Enableapntype ()-> setenabled ()-> handlemessage-> case event_enable_new_apn-> onenableapn ()]
{Here, we will explain that both cdmaphone and gsmphone inherit phonebase. dataconnectiontracker is a member field of phonebase. The initialization of this object is in the cdmaphone and gsmphone classes respectively, corresponding to the CDMA dataconnectiontracker and gsmdataconnectiontracker, because these two classes inherit the dataconnectiontracker, respectively, therefore, we need to call the function of that class according to the previous information about cdmaphone or gsmphone.
Example .}
Frameworks \ base \ telephony \ Java \ com \ Android \ internal \ telephony \ GSM \
Gsmdataconnectiontracker. Java extends dataconnectiontracker
-> [Onenablenewapn ()-> cleanupconnection ()-> conn. Disconnect (obtainmessage (event_disconnect_done, reason)]

Frameworks \ base \ telephony \ Java \ com \ Android \ internal \ telephony \
Dataconnectiontracker. Java
-> [Handlemessage-> case event_disconnect_done-> ondisconnectdone ()]
Frameworks \ base \ telephony \ Java \ com \ Android \ internal \ telephony \ GSM \
Gsmdataconnectiontracker. Java
-> [Ondisconnectdone ()-> trysetupdata (reason)-> setupdata (reason)]
Frameworks \ base \ telephony \ Java \ com \ Android \ internal \ telephony \
Dataconnection. Java
-> [Processmessage-> case event_connect-> onconnect (CP)]

Frameworks \ base \ telephony \ Java \ com \ Android \ internal \ telephony \ GSM \
Gsmdataconnection. Java
-> [Phone. mcm. setupdatacall ()]
{Phone. the MCM type is commandsinterface, which is determined based on javasaphone or gsmphone. The two are RIL instances. RIL implements commandsinterface is determined by the RIL constructor according to the networkint mode parameter. NOTE: If it is sip, the phone. MCM is passed to the phonebase constructor of the parent class through the sipphonebase constructor. The commandsinterface parameter is used to implement the sipcommandinterface.
Because sipphonebase implements phone, sipcommandinterface implements commandsinterface}
RIL
-> [Setupdatacall ()]
Here, the pppd request of the Java layer is sent to the C layer through RIL.

Framework diagram called:

Post reposted from: Click to open the link

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.