Incallscreen.java
Copy the display of the call interface and provide an interface for human-computer interaction. Enter the interface first call OnCreate. Otherwise enter onnewintent, the profile is Incall_screen.xml, Incallpanel for the call contact information and status display, configuration file for Call_card.xml, includes the view definition for two calls; Incalltouchui displays the control UI through management. The corresponding configuration file is incall_touch_ui.xml;
The handlemessage method of the Mhandle receives changes in the different phone states emitted by the callmanager of the framework. Update the UI. The type of consumer interest is as follows:
supp_service_failed: Eject Msuppservicefailuredialog
phone_state_changed: Call Requestupdatescreen Method Request Update call interface, send request_update_screen message
Request_update_screen: Internal call Updatescreen
Phone_disconnect: Called when a call connection fails. Exit the call screen in Delayedcleanupafterdisconnect
handleonscreenbuttonclick Click button in response to call control, related processing logic involved in call capability control
static methods in the Phoneutils class. such as answering the phone, hang up the phone, resume, maintain calls and other call control operations.
Contact information: Callcard
Call contact information display and update is really incallscreen updatescreen, call callcard updatestate square method, Displaymaincallstatus displays information for updating the first call. Displayonholdcallstatus Displays the second call information that holds the hold call. Gets the Callerinfo object through Phoneutils.getcallerinfo. The basic information for the call contact is saved.
Incalltouchui Call Control:
Incomingcallwid Get : Need to be used when on/off/SMS reply;
Manageconferencebutton : Multi-party call interface Jump control button, only when the multi-party call is displayed.
Dialpadbutton : That is to show or hide the dial pad (DTMF);
Audiobutton : Turn the speaker on/off;
Mutebutton : Turn microphone mute on/off. You can't hear your voice when you turn it on.
Holdbutton : Turn on/off call hold.
AddButton : Add a multi-channel call. That is, in the process of the call can suspend the current call, call and all the way to call and connect;
Call control related controls are updated in the Incalltouchui updatestate to implement the Ontriggerlistener interface, which is a lock screen control interface, where 4.2 has been changed. In the Ontrigger function. The 0,1,2 is defined directly in the up, left, and right three directions without the Slidingtab class. In Incallscreen's Onresume and OnPause register Action_headset_plug receive headphones hands-free event broadcast, send event_headset_plug_state_changed messages, Call Showaudiomodepopup to display the menu and enter Incalltouchui's onmenuitemclick to toggle the audio output strategy.
Dtmftwelvekeydialer
The layout file is Dtmf_twelve_key_dialer_view.xml and consists of the input box Dtmfdialerfield and the 12 button dialpad.xml.
phoneglobals:
4.2 Moves the contents of the Phoneapp in 4.0 to Phoneglobals.
Mwakelock and Mpartialwakelock are created in OnCreate for power management of the phone app.
After getting the mwakelock. The sleep time in the setting does not work and the screen is highlighted until the lock is released or the power key is pressed manually. When you get the Mpartialwakelock, you can turn off the screen and keyboard lights at this time. But not the horse is closed. Until the sleep time set is up. Off
the sensor sensor obtains the current position of the phone and infers whether the phone is near the face.
Mproximitywakelock Power wake-up lock, after getting, turn off the screen.
The mediabuttonboardcastreceive receives a broadcast event for the headset hook. Call Phoneutils's Handleheadsethook to respond to the headset's hook event.
phoneappboardcastreceive handles miscellaneous broadcast events in the phone app, such as flight mode, data connection, SIM status, and more.
callnotify:
Onnewringingconnect after receiving the incoming call processing, call Startincommingcallquery query contact information. Get gsmconnection userdata query to Callerinfo through Phoneutils's startgetcallerinfo.
onphonestatechanged The processing of change of call state.
ondisconnect Call connection disconnected processing. There are three types of connection disconnects Calllogtype:
Incomming_type (incoming
call)
Outgoing_type (call)
Missed_type (Missed Call)
Application layer analysis of android4.2 telephone