So you might be hearing Project Treble for the past couple of days and might not know what is it all about. We have gathered some information from XDA and put it in a nutshell. We have tried our best to keep it as simple as possible.
What is Project Treble?
Project Treble is most commonly described as an attempt by Google to modularize the Android OS framework to separate vendor specific code. Lets defragment what we just said in simpler points
- The process of compiling a new Android version to a particular device often takes quite long.
- The “vendor” usually refers to silicon-manufacturers such as Qualcomm,Mediatek but can also refer to the maker of any other proprietary hardware found in a device. The “device maker” or “OEM” usually needs to wait for the vendor to update their code so the proprietary hardware works with the Android OS framework in a newer version of Android.
- However, what is happening with Project Treble is that Google is requiring that any vendor-specific code be separated from the Android OS framework and instead live in its own vendor implementation. Usually this means that there is now a separate /vendor partition on Treble-enabled smartphones that contains a bunch of HALs (Hardware Abstraction Layers).
- Furthermore, vendors must implement code that lets the Android OS framework communicate with HALs in a standardized way. This is done via HIDL (HAL Interface Definition Language). With this in place, an OEM can work on an Android update without having to wait on vendors to update their HALs. This should speed up the Android update process as Vendors can update their code anytime.
What is HAL?
- To help understand what a HAL is and how it relates to Android, let’s consider an analogy. Imagine a car. The steering wheel and brakes are the HAL while the driver is the Android OS framework. The driver (Android) moves the steering wheel and presses on the brakes (the HAL) in order to control the movement of the car (the hardware).
- Now imagine if we lived in a world where every car manufacturer decided to design their steering wheels or re-arrange their brakes in a completely different way. If you put a driver in a new car, they may be confused with how to initially handle the vehicle. But thanks to standards, every driver should be familiar with how to operate a steering wheel and brakes on almost any car. Further, driving school teaches all drivers the proper way to operate a vehicle. In this analogy, the vehicle standards are Project Treble and driving school is HIDL.
Which devices will have Project Treble support?
- Google has made it mandatory that all devices that launch with Android Oreo should support Project Treble.
- In case you get an upgrade to Oreo then the device need not support Project Treble.
- Its not possible to get unofficial Project Treble support via custom ROM development.
Project Treble for AOSP ROMs
- To ensure that the vendor code is properly separated from the Android OS framework in the manner that Project Treble requires, Google has set up a Vendor Test Suite (VTS) which devices must pass in order to be certified by Google. Google certification is important because without it a device are not allowed to ship with Google Play apps and services pre-installed.
- One of the requirements in the VTS is that a Treble-enabled device must be able to boot a raw, generic AOSP build. Because of this requirement, OEMs have to ship devices that can boot AOSP without any issues.
- AOSP ROMs are guaranteed to be bootable on Project Treble devices.
Project Treble will completely change the way Android works and perhaps this change was much needed. It took less than one day to boot a nearly fully functional AOSP ROM on the Huawei Mate 9.