"Turn" Android 4.4 Kitkat Phone comparison 5.0 Lollipop phone work flow analysis

Source: Internet
Author: User

Overview

In Android 4.4, Google has refactored the Telephony_phone, and has previously analyzed the workflow of telephony phone in Android 4.4 through some column articles. But on October 15, 2014, Google released the Android 5.0 preview, and the official version was released one months later. Android 5.0 has changed so much that Google has made drastic changes, both in terms of UI style and feature implementation. At the same time, the architecture of the Telephony_phone module has been adjusted again, the adjustment of the telephony_phone between the various modules less coupling, division of labor is more clear, but the whole process has become more complex.

This article is from Http://blog.csdn.net/yihongyuelan reprint please be sure to indicate the source

Is the Android 4.2 to 5.0,telephony phone module structure changes:

Figure 1 Android Telephony Phone Architecture Evolution

In Android 4.2 and earlier, the Telephony phone module mainly covers the parts of the phone and contacts as well as the Telephony framework. In Android 4.4, the phone module was replaced by Incallui and Teleservice, where Incallui was packaged in dialer.apk. Incallui is primarily responsible for UI display, while Teleservice is responsible for logical processing.

In Android 5.0, the Telephony service is the original Teleservice, and some features are extracted into the telecom service and telecom framework. The entire Telephony phone module consists of 5 parts: Incallui, Telecom Service, Telecom framework, Telephony Service, Telephony framework. The new Telecom framework is packaged in Framework.jar and Telecom service is packaged in telecom.apk.

From Android 4.2 to 5.0,telephony phone module refinement, the function of each sub-module is more streamlined. Of course, this conforms to the object-oriented requirements, but also causes the interaction between the modules to increase correspondingly. The entire telephony phone evolution process can be simply summed up as:

Figure 2 Simplified Phone Architecture Evolution

About Android 5.0 Incallui

Android 5.0 has tweaked the Incallui interface to fit Google's material Design.

Figure 3 Incallui Incall process (pictrue from @Eric Li)

Figure 4 Incoming Call (Pictrue from @Eric Li)

In Android 5.0, Incallui added a new rendering mode, immersive mode, as long as the non-lockscreen interface calls, the incoming call information will be displayed as a floating notification. The notification is a heads-up type of notification that pops up in the status bar when triggered to prompt the user. Any one of the notification can be displayed in heads-up Way, just set the Fullscreenintent property to Notification.builder:

[Java]View Plaincopy
    1. Builder.setfullscreenintent (Pendingintent Intent, boolean highpriority)

If the system is in the lock screen when the heads-up notification is ejected, Notificationmangerservice executes the action specified by Pendingintent. such as: the lock screen when the call will start Incallactivity, and because Incallactivity has the following properties:

[Java]View Plaincopy
    1. GetWindow (). Addflags (WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);

Therefore, the lock screen is lifted and the incallactivity is displayed.

Figure 5 Multiple calls UI (Pictrue from @Eric Li)

Figure 6 Conference calls UI (Pictrue from @Eric Li)

Android 4.4 vs 5.0 MO/MT

You have previously analyzed the MO/MT process for Android 4.4, see:

An analysis of the workflow of Android 4.4 Kitkat Phone (iii) __MO (power off) process

An analysis of the workflow of Android 4.4 Kitkat Phone (v) __MT (incoming call) process

Mo is called the mobile origination call, that is, to power. Mainly include: dial, Start UI interface, Update call status , MT is mobile termination call is called, that is, call. Mainly includes: Bell, start UI interface, Update call status . In Android 4.4, the entire MO/MT executes process 7:

Figure 7 Android 4.4 MO/MT Flowchart

Mo key steps are as follows

①. Dial

The pink arrows are indicated in the figure. Dial is initiated from the dialpad of dialer and is sent to the Telephony service to continue processing.

②. Start Incallui

The green arrows are indicated in the figure. In Android 4.4, when dial initiates and arrives at Ril, RIL will send the dial request to the modem side, and the modem will return to the dialing state. RIL receives the dialing status and feeds the information back to the telephony Service, eventually reaching Incallui and starting the interface and displaying the content based on the current call status (dialing).

③. Update Call State

The green arrows are indicated in the figure. In Android 4.4, the call status is changed from idle to dialing, so the update call state process is consistent with the start Incallui process, but start Incallui executes only once, The update call state is executed several times during the conversation, such as from active to hold.

Mt Key steps are as follows

①. Ringing

Shown in the Orange arrow in the figure. Ringing is actually a type of call state, so it is initiated from the modem side and passed to Ril, which is then escalated and eventually displayed to Incallui. The only difference from update call state is that MT calls ringer in Callnotifier to perform a play ring operation.

In Android 4.4, the MO process can be divided into two steps, dial and Update call state (Start Incallui is included in the update call state process). The MT process is also divided into two steps, update call state and ringing.

Android 4.4 Telephony Phone architecture is very clear, each sub-module is more independent. such as telephony service and incallui through Callhandlerservice, Callhandlerserviceproxy and Callcommandclient, Callcommandservice interacts mainly with Com.android.incallui (Incallui), Com.android.dialer (dialer), Com.android.phone ( Telephony Service) Three processes. Although architecturally clear, Incallui and telephony service bindings are too tight, and the telephony service is bloated.

In Android 5.0, the telephony service separates some features into the Telcom service and telecom framework. Android 4.4 is compared to the 5.0 Telephony phone architecture, as shown in:

Figure 8 Architecture Difference (Simplified)

Can see the telephony phone architecture from Android 4.4 when the three layer into Android 5.0 when the four layer, where the new part of Android 5.0 is separated from the original telephony service. From the process model analysis, in Android 5.0, Telephony phone workflow mainly includes: Com.android.incallui (Incallui), Com.android.dialer (dialer), com.android.server.telecom (Telecom Service), Com.android.phone (Telephony service) four processes.

Android 5.0 Telephony Phone MO process changes are large, the key steps are as follows:

Figure 9 Android 5.0 MO flowchart

The MO process is divided into three steps, namely Dial,start incallui,update call state. In the Android 4.4 process, the Update call state contains the start Incallui, while the steps in Android 5.0 are very clear. As you can see, there is no direct interaction between the Incallui, Telecom service, or telephony service, and all interactions are made with the framework. The most important point is that incallui is no longer bound to the Telephony service or telecom service, and each module is very independent.

The Android 5.0 Telephony Phone mo detailed flow as shown:

Figure MO Dial/start incallui/update call State Flowchart

Android 5.0 Mo Detailed process is divided into four steps, namely start Incallui, execute dial Action, update dialing status, call status change update. As you can see, the Incallui is started before the call state changes and the interface is updated again after the call state changes to dialing.

The key steps of the Android 5.0 Telephony Phone MT Process as well as the detailed process, as shown in:

Figure One Android 5.0 MT Flowchart

Figure MT Ringing and Update call state Flowchart

In the Android 5.0 Telephony Phone MT Process, the Start Incallui is still included in the update call state process, and Ringer is invoked to perform related ringing operations in Callsmanager.

Telecom Introduction

The telecom Service (PACKAGES/SERVICES/TELECOMM) and telecom Framework (FRAMEWORK/BASE/TELECOMM) have been added to Android 5.0, These two parts are separated by the telephony service, although the telephony service still exists in Android 5.0, but the responsibility for the transaction has changed.

Telecom is a generic term for the telecom Service and telecom framework, which is responsible for all data services. The phone, call, and connection objects that the upper app (Incallui) touches are actually the phone, call, and connection objects of the telecom framework, not telephony Gsmphone, Gsmcall, and gsmconnection in the framework.

The phones and call in the Telecom framework replaced the Callcommandservice and Callhandlerserviceproxy in the Android 4.4 Telephony service, Responsible for the transmission of call data and control instructions issued. The Callsmanager in the Telecom service is responsible for the processing of all call data and instructions, and passes the results to the telecom Framework.

Android 4.4 vs. 5.0 call State

In the previous blog post, there is an analysis of the call status in Android 4.4 (see the Android 4.4 Kitkat phone workflow Analysis (eight) __phone status analysis, Android 4.4 Kitkat Phone Workflow Analysis (ix) __ Status Notification process analysis), the call status changes with the telephony phone architecture change in Android 5.0. As shown in the respective call states and their corresponding relationships in Android 4.4:

Figure Android 4.4 Call State Overview (MTK)

Where Msg_type is the parameters that are carried in the +ECPI directive of MTK.

The call status distribution and conversion in Android 5.0 are as follows:

Figure Android 5.0 call State distribution diagram

The types of call state in Android 5.0 include:

1. Drivercall.state. Used to describe the state of a modem;

2. Call.state (Telephony Framework). Used to describe the call state, where call contains Gsmcall, Cdmacall;

3. Connection (Telecom Framework). Used to describe the state of each connection, each connection state is derived from the state of the owning call;

4. Callstate (Telecom Framewok). Because the upper layer changes introduced the pre_dial_wait state, but this state does not exist in the telephony Framework call.state, so the use of callstate to convert;

5. Call (Telecom Framework). The further abstraction of the Telephony Framework call.state derives from the transformation of Callstate and is also the source of call.state in Incallui;

6. Call.state (Incallui). Define the status of call in Incallui;

7. Incallstate (incallpresenter). Incallactivity status, used to control UI updates;

The call status in the Telephony phone is stipulated by the agreement that the new pre_dial_wait cannot be changed on the modem side, so it can only be modified in the framework and processed accordingly. Call states and their respective relationships in Android 5.0:

Figure Android 5.0 Call State Overview (AOSP)

From the above analysis you can know:

①. Incallstate two new states, Pending_outgoing and Waiting_for_account

When a user has more than one account and no default account is set, a prompt will pop up after dialing to allow the user to select an account (Internet account/sim1/sim2), at which time the status is Waiting_for_account waiting for the user to enter. In Android 5.0, Incallui does not wait for the call state to change and then start, the pre-boot Incallui status is pending_outgoing, and then the outgoing state.

②. Telephony Framework call.state and Drivercall.state no changes

In Android 5.0, the conversion relationship between the Telephony Framework call.state, as shown, is consistent with Android 4.4:

Figure Telephony Call.state Conversion Relationship

Summary

The Android 5.0 Telephony phone is significantly different from the previous UI or architecture. The architectural differences are mainly reflected in the addition of the telecom service and the telecom Framework, where all call data services are processed from the Telephony service transfer Telecom. The differences in the UI are mainly adapted to the new material Design introduced by Android 5.0, and introduced the Heads-Up notification caller interface.

Changes in the architecture have also led to changes in the MO/MT process, which is more complex than it was originally, but each submodule is more independent. If the Incallui only relies on the framework, if Framewrok exposes the appropriate interface (call/phone/incallserviced, etc.), the three-party app can easily implement Incallui functionality.

"Turn" Android 4.4 Kitkat Phone comparison 5.0 Lollipop phone work flow analysis

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.