Connection. hangup () and call. hangup () in Android ()

Source: Internet
Author: User

When I see so many hangup () of phoneutil, the headers are a bit dizzy. Let's just repeat it in detail.
------- Gsmo. Java ---------
Public void hangup () throws callstateexception
{
If (! Disconnected ){
Owner. hangup (this); // The owner is the gsmcalltracker object.
} Else {
Throw new callstateexception ("disconnected ");
}
}
-------- Gsmcall -------------------
Public void hangup () throws callstateexception
{
Owner. hangup (this); // The owner is the gsmcalltracker object.
}
It can be seen that the hangup () is polymorphism by gsmcalltracker, and then the commandinterface object cm. hangupconnection () must be used for hanging up. Commandinterface is originally an interface class. After RIL implement is passed, and then> A commandinterface object is created in phonefactory.
In phonefactory. Java, new phoneproxy (New gsmphone (context, scommandsinterface, sphonenotifier); phoneproxy is the proxy of cdmaphone and gsmphone. The context parameter is actually a phoneapp object.
After talking about phonefactory. makedefaltphones (this) and passing it to phonefactory, scommandsinterface is the object traced back from the RIL object. scommandsinterface = new RIL (context, networkmode, cdmasub.pdf );
In RIL. Java
Public void hangupconnection (INT gsmindex, message result ){
If (rilj_logd) riljlog ("hangupconnection: gsmindex =" + gsmindex );
Rilrequest RR = rilrequest. Obtain (ril_request_hangup, result );
If (rilj_logd)
Riljlog (RR. serialstring () + ">" + requesttostring (RR. mrequest) + "" + gsmindex );
Rr. MP. writeint (1 );
Rr. MP. writeint (gsmindex );
Send (RR );
}

After the rilsender in RIL receives the sent message, it will eventually send the hanging request through socket.
S. getoutputstream (). Write (datalength );
S. getoutputstream (). Write (data );

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.