I've downloaded the entire source code for the master branch from https://android.googlesource.com/platform/frameworks/base/+/master, and am trying to decipher the chain of events on an incoming call.
I assume that the ACTION_ANSWER intent is started but beyond that don't know what happens before or after.
Can anyone help?
Let's begin by looking at CallNotifier:
One of the messages that this Handler responds to is:
CallStateMonitor.PHONE_NEW_RINGING_CONNECTION
:onNewRingingConnection(AsyncResult)
eventually (and, in general case) callsringAndNotifyOfIncomingCall(Connection c)
:CallModeler.onNewRingingConnection(Connection)
(Link) notifies attached listeners:These listeners implement
CallModeler.Listener
interface. CallHandlerServiceProxy is one such listener, and itsonIncoming(Call)
callback firesCallHandlerServiceProxy.processIncoming(Call)
:CallHandlerService defines a
ICallHandlerService.Stub
member and itsonIncoming(Call, List<String>)
method looks like:This is how
mMainHandler
handles caseON_UPDATE_CALL_WITH_TEXT_RESPONSES
:CallList keeps a list of listeners that implement
CallList.Listener
, and fires theironIncomingCall(Call)
event from itsCallList.onIncoming(Call, List<String>)
method.Now, let's look at InCallPresenter:
InCallPresenter
implementsCallList.Listener
interface, and is responsible for launchingInCallActivity
that provides the UI for all phone related operations. The following comment (taken fromInCallPresenter.startOrFinishUi(InCallState)
) brings the above-mentioned chain of events together:I hope this answers your question, or at the very least, shows you where to look. Feel free to correct anything I overlooked/misinterpreted.
Hope below Code Help you.
The google reference is
http://developer.android.com/reference/android/telephony/TelephonyManager.html
have a look at this Grep code InCallScreen.java