Android 4.4 Kitkat Phone comparison 5.0 Lollipop Phone workflow analysis, kitkatlollipop

Source: Internet
Author: User

[Switch] Android 4.4 Kitkat Phone comparison 5.0 Lollipop Phone workflow analysis, kitkatlollipop
Overview

In Android 4.4, Google reconstructed Telephony_Phone, and analyzed the workflow of Telephony Phone in Android 4.4 in the previous articles. However, in October 15, 2014, Google released the Android 5.0 preview version, and the official version was also released one month later. Android 5.0 has changed a lot. In terms of UI style and function implementation, Google has made drastic changes. At the same time, the architecture of the Telephony_Phone module has been adjusted again. After the adjustment, the coupling between the adjusted Telephony_Phone modules is lower and the division of labor is clearer, but the entire process is much more complicated.

 

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

 

Is the structure change of the Telephony Phone module from Android 4.2 to 5.0:

Figure 1 Android Telephony Phone Architecture Evolution

In Android 4.2 and earlier versions, the Telephony Phone module mainly involves Phone, Contacts, and Telephony Framework. In Android 4.4, phoneiis replaced by incalluiand teleservice, and incallui is packed into dialer.apk. InCallUI is mainly responsible for UI display, while TeleService is responsible for logic processing.

In Android 5.0, Telephony Service is the original TeleService. Some functions are extracted to Telecom Service and Telecom Framework. The entire Telephony Phone module consists of five parts: InCallUI, Telecom Service, Telecom Framework, Telephony Service, and Telephony Framework. The Newly Added Telecom Framework is packaged into framework. jar, and Telecom serviceis packaged into telecom.apk.

From Android 4.2 to 5.0, the Telephony Phone module becomes more detailed, and the functions of each sub-module become more and more streamlined. Of course, this meets the object-oriented requirements, but it also increases the interaction between modules. The entire Telephony Phone evolution process can be summarized as follows:

Figure 2 Simplified Phone Architecture Evolution

Introduction to Android 5.0 InCallUI

Android 5.0 adjusted the InCallUI interface to adapt to 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 adds a new rendering method, namely, Immersive Mode. As long as you call on a non-LockScreen interface, the incoming call information is displayed as a floating notification. This Notification is a Heads-up Notification. When triggered, it will pop up in the status bar to prompt the user. Any Notification can be displayed in Heads-up mode. You only need to set the FullScreenIntent attribute for Notification. builder:

[Java]View plaincopy
  1. Builder. setFullScreenIntent (PendingIntent intent, boolean highPriority)

If the system is locked when Heads-up Notification is displayed, icationicationmangerservice executes the Action specified by PendingIntent. For example, when the screen is locked, InCallActivity is started because InCallActivity has the following attributes:

[Java]View plaincopy
  1. GetWindow (). addFlags (WindowManager. LayoutParams. FLAG_DISMISS_KEYGUARD );

Therefore, the screen lock is removed and InCallActivity is displayed.

 

Figure 5 Multiple cils ui (pictrue from @ Eric Li)

Figure 6 Conference cils ui (pictrue from @ Eric Li)

Comparison between Android 4.4 and 5.0 MO/MT

I have analyzed the MO/MT process of Android 4.4 before. For details, see:

Android 4.4 Kitkat Phone workflow analysis (iii) _ MO (Power removal) Process Analysis

Android 4.4 Kitkat Phone workflow analysis (v) _ MT (incoming call) Process Analysis

MO is called Mobile Origination Call. It mainly includes:Dial up, start the UI, and update the call statusMT is called by Mobile Termination Call, that is, a Call. It mainly includes:Ring the bell, start the UI, and update the call status. In Android 4.4, the entire MO/MT execution process is 7:

Figure 7 Android 4.4 MO/MT flowchart

The key steps of MO are as follows:

①. Dial

The pink arrows in the figure indicate. Dial is initiated from Dialer's Dialpad and is sent to Telephony Service for further processing.

②. Start InCallUI

The green arrows in the figure indicate. In Android 4.4, after Dial is initiated and reaches RIL, RIL sends the Dial request to the Modem end, And the Modem end returns the DIALING status. After receiving the DIALING status, RIL sends the information to Telephony Service, and finally reaches InCallUI. Then, it starts the interface based on the current call status (DIALING) and displays the corresponding content.

③. Update Call State

The green arrows in the figure indicate. In Android 4.4, the change of the Call status from IDLE to DIALING is also in the scope of Call State change. Therefore, the Update Call State process is consistent with the Start InCallUI process, but Start InCallUI will only be executed once, the Update Call State is executed multiple times during a Call, such as switching from ACTIVE to HOLD.

The MT key steps are as follows:

①. Ringing

The orange arrow is shown in the figure. Ringing is actually a type of Call status, so it is also initiated from the Modem and passed to RIL, and then reported step by step and finally displayed in InCallUI. Unlike the Update Call State, MT calls Ringer in CallNotifier to play the ringtone.

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 has a clear architecture and its sub-modules are also relatively independent. For example, Telephony Service interacts with InCallUI through CallHandlerService, CallHandlerServiceProxy, CallCommandClient, and CallCommandService, mainly involving com. android. incallui (InCallUI), com. android. dialer (Dialer), com. android. phone (Telephony Service) three processes. Although the architecture is clear, InCallUI and Telephony Service are too tightly bound, and Telephony Service is also very bloated.

In Android 5.0, Telephony Service separates some functions from Telcom Service and Telecom Framework. Comparison between Android 4.4 and 5.0 Telephony Phone architectures, as shown in:

Figure 8 Architecture difference (Simplified)

We can see that the Telephony Phone architecture is changed from the Layer 3 at Android 4.4 to the Layer 4 at Android 5.0. The new part of Android 5.0 is separated by the original Telephony Service. According to the process model analysis, in Android 5.0, Telephony Phone's workflow mainly includes: com. android. incallui (InCallUI), com. android. dialer (Dialer), com. android. server. telecom (Telecom Service), com. android. phone (Telephony Service) processes.

The process of the Android 5.0 Telephony Phone MO is greatly changed. The key steps are shown in:

Figure 9 Android 5.0 MO flowchart

The MO process consists of three steps: Dial, Start InCallUI, and Update Call State. In the process of Android 4.4, the Update Call State contains Start InCallUI, and the steps in Android 5.0 are very clear. We can see that neither InCallUI, Telecom Service nor Telephony Service interacts directly, and all interactions are with the Framework. The most important thing is that InCallUI is no longer bound to Telephony Service or Telecom Service, and each module is very independent.

The detailed process of Android 5.0 Telephony Phone MO is shown in:

Figure 10 MO Dial/Start InCallUI/Update Call State Flowchart

The detailed process of Android 5.0 MO is divided into four steps: Start InCallUI, execute Dial Action, update Dialing status, and Call status change and update. As you can see, InCallUI is started before the Call status changes. After the Call status changes to Dialing, the interface is updated again.

The key steps and detailed processes of the Android 5.0 Telephony Phone MT process are as follows:

Figure 11 Android 5.0 MT Flowchart

Figure 12 MT Ringing and Update Call State Flowchart

In the Telephony Phone MT process of Android 5.0, Start InCallUI is still included in the Update Call State process. At the same time, Ringer is called in CallsManager to execute the related Bell action.

About Telecom

In Android 5.0, Telecom Service (packages/services/Telecomm) and Telecom Framework (framework/base/telecomm) are added, which are separated by Telephony Service, although Telephony Service still exists in Android 5.0, the transaction in charge has changed.

Telecom is a general term for Telecom Service and Telecom Framework. It is mainly responsible for all data services. The Phone, Call, and Connection objects exposed by the upper-layer APP (InCallUI) are actually Phone, Call, and Connection objects of the Telecom Framework. They are not the GSM Phone, GsmCall, and GsmConnection objects in the Telephony Framework.

In the Telecom Framework, Phone and Call replace CallCommandService and CallHandlerServiceProxy in Android 4.4 Telephony Service, which are responsible for transmitting Call data and issuing control commands. The CallsManager in Telecom Service is responsible for processing all the call data and commands, and passing the results to Telecom Framework.

Comparison between Android 4.4 and 5.0 Call State

In the previous blog posts, I analyzed the Call status in Android 4.4. (For details, see "Android 4.4 Kitkat Phone workflow analysis (8) _ Phone status analysis, Android 4.4 Kitkat Phone workflow analysis (9) _ Status notification process analysis, with the change of Telephony Phone architecture in Android 5.0, the Call status also changes. Shows the Call statuses in Android 4.4 and their corresponding relationships:

Figure 13 Android 4.4 Call State Overview (MTK)

Msg_type is the parameter carried in the MTK + ECPI command.

Shows the Call status distribution and transition in Android 5.0:

Figure 14 Android 5.0 Call State distribution

In Android 5.0, the following types of Call states are available:

1. DriverCall. State.Describes the modem status;

2. Call. State (Telephony Framework ).Used to describe the Call status. The Call here includes GsmCall and CdmaCall;

3. Connection (Telecom Framework ).Describes the status of each Connection. Each Connection status comes from the status of the Call;

4. CallState (Telecom Framewok ).The upper-layer changes Introduce the PRE_DIAL_WAIT status, but this status does not exist in Telephony Framework Call. State. Therefore, CallState is used for conversion;

5. Call (Telecom Framework ).The further abstraction of Telephony Framework Call. State is derived from the CallState conversion and is also the source of Call. State in InCallUI;

6. Call. State (InCallUI ).Define the Call status in InCallUI;

7. InCallState (InCallPresenter ).InCallActivity status, used to control UI updates;

The Call status in Telephony Phone is stipulated by the Protocol. The new PRE_DIAL_WAIT cannot be modified on the Modem end. Therefore, it can only be modified in the Framework and processed accordingly. The status of the Call in Android 5.0 and Its Relationship:

Figure 15 Android 5.0 Call State Overview (AOSP)

The above analysis shows that:

①. Two new statuses are added for InCallState, namely PENDING_OUTGOING and WAITING_FOR_ACCOUNT.

When a user has multiple accounts and no default account is set, a prompt box is displayed asking the user to select an account (Internet account/SIM1/SIM2). The status is WAITING_FOR_ACCOUNT, which is waiting for user input. In Android 5.0, InCallUI is not started after the Call status changes. The InCallUI status in advance is PENDING_OUTGOING, and then changes to the OUTGOING status.

②. Telephony Framework Call. State and DriverCall. State are not changed.

In Android 5.0, The Conversion Relationship Between Telephony Framework Call. State is shown in, consistent with Android 4.4:

Figure 16 Telephony Call. State conversion relationship

Summary

Android 5.0 Telephony Phone differs greatly in both the UI and architecture. The differences in architecture are mainly reflected in the addition of Telecom Service and Telecom Framework. The processing of all call data services is transferred from Telephony Service to Telecom. The differences in the UI mainly adapt to the newly introduced Material Design in Android 5.0, and introduce the Heads-up Notification incoming call interface.

The change in architecture also leads to changes in the MO/MT process. The new process is more complex than the original one, but each sub-module is more independent. For example, InCallUI only depends on the Framework. If Framewrok exposes the corresponding interfaces (Call/Phone/InCallServiced), the third-party APP can easily implement the InCallUI function.

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.