Android Treble Architecture: Part 1 - Introduction

Introduction.

Android is a mobile operating system developed by Google, based on a modified version of the Linux kernel and other open source software and designed primarily for touchscreen mobile devices such as smartphones and tablets. In addition, Google has further developed Android TV for televisions, Android Auto for cars, and Wear OS for wrist watches, each with a specialized user interface. Variants of Android are also used on game consoles, digital cameras, PCs and other electronics.

Initially developed by Android Inc., which Google bought in 2005, Android was unveiled in 2007, with the first commercial Android device launched in September 2008. The operating system has since gone through multiple major releases, with the current version being 8.1 "Oreo", released in December 2017.

Version History.

The version history of the Android mobile operating system began with the public release of the Android beta on November 5, 2007. The first commercial version, Android 1.0, was released on September 23, 2008.

Without a doubt, Treble or “Project Treble” has been the most biggest and boldest change which has been done in Android framework since Android.

Before we ask questions like.
1.     What is Treble
2.     How does it affect me [OEM/SOC vendor etc]
3.     What should I be doing next?
4.     What are the associated changes? And many others.

The most important question still remains “WHY WAS TREBLE NECESSARY or WHAT DOES TREBLE SOLVE

In this part of the tutorial let us try and build the initial understanding of the problem which Treble claims to solve not just for parties involved.


From the Google release dashboards we see this problem in front of our eyes.



  

Or, The following figure even better.




As we can see from the above 2 pictures, It is quite evident that even after being the most used Operating System on the planet, Android still suffers from a big problem. The problem of FRAGMENTATION.

To understand more on the importance of the Problem, Let us see one more picture.


If we were to over simplify this problem, A statement would be

“The Latest and Greatest version of Android aka “OREO” just runs on < 6% of all the devices out there”.

Also note that Old versions like Marshmallow and Lollipop [2014-2015 releases] still make up more than 50% of the devices.

Whom does this Fragmentation affect?

Well, It affects everyone associated directly or indirectly with Android.
Let us see.
1.     Customers: As a customer we would like to get the best of what Google creates in their latest Android version.
2.     OEM: The timely update of devices would make them less vulnerable to security issues.
3.     Google : Well, Google does all the hardwork to finally see very less percentage of devices having latest Android version and that surely would hurt them.

What about other Operating Systems.

Now, Let us take a pause and compare this to something like an ios kind of system.



We can clearly see a starlkling difference here when compared.
The latest version of ios aka “ios 11” runs on almost staggering 87% of the devices out there.

What causes this Fragmentation?

Let us understand what causes this problem [Please take them with a pinch of salt as I might be oversimplifying things sometimes].


The following figure on the Google’s official developer blog helps us understand more.
  


source: https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html

Life of an Android Release.

1.     The Android team publishes the open-source code for the latest release to the world.
2.     Silicon manufacturers, the companies that make the chips that power Android devices, modify the new release for their specific hardware.
3.     Silicon manufacturers pass the modified new release to device makers — the companies that design and manufacture Android devices. Device makers modify the new release again as needed for their devices.
4.     Device makers work with carriers to test and certify the new release.
5.     Device makers and carriers make the new release available to users.

However, Before we can get over all of these steps Google would have already released or would be about to release the next android version and this causes the wheel to rotate again.

What are the most important issues in getting an update?

1.     Difficulty: Many changes over and top of the core Android framework and their close coupling [We will re-visit this in greater detail later].
2.     Cost: Of course, There is a big cost involved in Engineering and testing the changes not just at the SOC vendor level but also at the OEM and the carrier level.
3.     Long: Sometimes depending on the customizations done [For obvious reasons] this process is very lengthy and might take months.


So, In comes the Hero, The Savior Treble”.

Project Treble aims to do what CTS did for apps, for the Android OS framework. The core concept is to separate the vendor implementation — the device-specific, lower-level software written in large part by the silicon manufacturers — from the Android OS Framework.

This is achieved by the introduction of a new vendor interface between the Android OS framework and the vendor implementation. The new vendor interface is validated by a Vendor Test Suite (VTS), analogous to the CTS, to ensure forward compatibility of the vendor implementation.


 Let us see how Google expects Treble to help the software update problems.




With a stable vendor interface providing access to the hardware-specific parts of Android, device makers can choose to deliver a new Android release to consumers by just updating the Android OS framework without any additional work required from the silicon manufacturers:
Scale and Statistics.

Just to set the context right, Google has worked with the SOC companies, kernel community [yes a lot of things have changed in the kernel to support this] and across their entire framework to get this working. And ohh! Yes, Did i mention that kernel 4.4 LTS support will be for 6 years and not 2 years.

From the following picture from one of the Linaro connect videos , We can easily see the scale of the changes done as part of Treble.







Did you know how many subsystem conversions underwent Google’s Treble specific changes?

A simple command on the terminal “find ./interfaces/ -maxdepth 2 -type d”
@ the location of platform/hardware/interfaces/ would result in the following.




We will get into the greater details of the changes done by Google as part of Project Treble in the coming sub parts of this tutorial.

For the next set of tutorials, I will use Android version android-8.1.0_r9 as our reference.


Comments

  1. Its very helpful. you explain very well about Android Architecture. Thanks for sharing.

    ReplyDelete

Post a Comment

Popular posts from this blog

Android Audio Tutorial [Part Three] : AudioFlinger Introduction and Initialization

Android External Storage Support: Volume Daemon (vold) Architecture

Android Audio Tutorial [Part One] : Introduction