Key Takeaways

While iOS updates can be usually installed on all supported devices the day they are released, Android updates are annoyingly slow to roll out.

Project Treble is an attempt to remedy this entire set of problems by relying on a clearer split between hardware and software through the Hardware Abstraction Layer (HAL).

Before Project Treble and Android Oreo, the vendor’s low-level hardware code and Google’s higher level AOSP operating system, including the HAL, were a monolith.

Thanks to Project Treble’s integration, Google will be able to update the higher level AOSP operating system code to the latest version while OEMs will update the lower level hardware-related components.

Key to Project Treble are the definition of a clear interface between the HAL and its users through the Hardware Definition Language (HIDL) and the Android Vendor Test Suite (VTS), a set of tests that validates compatibility of the upgraded OS with the vendor implementation. About 60 HIDLs exist in the current iteration of Android.

While iOS updates can be usually installed on all supported devices the day they are released, Android updates are annoyingly slow to roll out. In fact, Android smartphones are lucky if they receive a couple of updates, with lower cost smartphones possibly never receiving a single software update in their entire lifecycle.

Project Treble is an attempt to remedy this entire set of problems. Before introducing it, it is helpful you understand the role the Hardware Abstraction Layer (HAL) plays in the Android OS framework.

Hardware Abstraction Layer (HAL)

The Hardware abstraction layer enables an OS to talk to the device hardware hiding its peculiarities from higher level programs. In other words, the HAL separates a device hardware from its Operating System, as the following image shows.

Just below the HAL lies the Linux kernel, which handles the hardware specific communication between the HAL and the device’s hardware components. Unlike iOS devices, Android devices tend to have different set of hardware components, which make the compiled Linux binary different for each device. This is in a nutshell where the fragmentation problem lies.

Before Project Treble

Before Project Treble and Android Oreo, the vendor’s low-level hardware code and Google’s higher level AOSP operating system, including the HAL, were a monolith.

That is, before Project Treble, for a vendor to upgrade its device to the latest version of Android, they had to update the vendor’s low-level hardware code and Google’s higher level AOSP operating system, which delayed upgrades to Android devices and put them under a security risk.

What is Project Treble and what Google is trying to achieve with it?

The major problem with Android updates is that phone manufacturers are slow to release them. Worse still, handset support is re-evaluated as new models arrive. Consumers have been vocal about this complaint to manufactures and Google for ages. Now, the arrival of Google’s Project Treble may change the way manufacturers issue software updates.

Yet, don’t get your hopes too high already as it will be still up to vendors to upgrade devices they sell.

What Project Treble isn’t?

Contrary to what you could believe, though, Project Treble won’t convert every device shipped with Android Oreo into a Pixel or a Nexus. Indeed, Google isn’t handling software updates itself and Android manufacturers still need to compile and roll out their updates. The Project is an effort by Google to speed up over-the-air (OTA) updates, but the responsibility to issue OTA updates still remains with the vendors. OTA updates will be pushed to your devices like any other update. You’ll see the Android update notification appearing more often, if Project Treble is successful.

What architectural changes Project Treble brings to the OS Framework?

Project Treble separates the Android OS framework from the vendor’s hardware code implementations. With that separation in place and thanks to Project Treble’s integration, Google will be able to update the higher level AOSP operating system code to the latest version while OEMs will update the lower level hardware-related components.

But that doesn’t solve the entire problem. OEMs still have to update the lower level components. And they still have to rely on SoC vendors who provide much of the hardware code, which defeats the whole purpose of the Project.

Solving the HAL issues with HIDLs

As we discussed above, the HAL facilitates the communication between the hardware components and the application. Android O formalized the division between HAL hardware components, like audio or the camera, and their clients on the the OS layer. These new formal divisions that specify the interface between an HAL and its users are described through an Hardware Definition Language (HIDL). About 60 HIDL packages exist in the current iteration of Android. HIDL packages can replace the OS frameworks without the need to rebuild the HAL and thus cut a vendor’s dependency on SoC makers to issue the next OTA update. That implies OTA updates can be issued without the need to recompile the HAL to absorb the changes brought in by the new Android version.

Of course, the hardware of Android devices awaiting upgrade to the next version of Android has to be compatible with that version. Before Treble, to issue a software update Android vendors were dependent on silicon manufacturers regardless of the device’s hardware compatibility with the current Android version. As Project Treble leaves the original vendor implementation intact, which includes hardware-specific code from silicon manufacturers (Qualcomm, Mediatek, Samsung etc.) and only updates the Android OS framework, this is not the case anymore.

The new Android version now only needs to be compatible with the unchanged vendor implementation of the Android device to be upgraded, which can be ensured for example by passing the Android Vendor Test Suite. The Android Vendor Test Suite (VTS) is a set of tests that validates compatibility of the upgraded OS with the vendor implementation. Once the compatibility is established, OEMs just have to update the AOSP operating system of OS framework to issue an OTA. VTS is a hardware-focused analog to the Compatibility Test Suite (CTS), which ensures the Android app APIs are properly implemented on a device.

Passing Android Vendor Test Suite (VTS) is essential for an Android device as the goal of HIDL is to replace OS framework without rebuilding HALs. HALs are built by silicon vendors and stay in the vendor partition of the device, enabling the OS framework, in its own partition, to be replaced with an OTA without recompiling the HALs.

Anyway, updating the AOSP OS is the minimum requirement to issue an OTA, but most vendors take the opportunity of an update to reskin the UI layer as well as bake their own software add-ons in. This takes time. So don’t expect Android upgrades to appear on your device within a few weeks of their release to the public. That honor still belongs to the Pixels and Nexus-es of the world.

In a nutshell, while the upgrade equation remains the same, Project Treble has taken away dependency from silicon vendors.

Reception

Leading online publications praised Project Treble for ironing out one of the biggest problems in the Android ecosystem, including the following:

Understanding Android manufacturers apprehension with Project Treble

Project Treble requires a storage partition, by which the Android framework and vendor image are separated. However, because partitions were not required of Android N and previous versions of Android, all of our current devices do not feature a partition. According to our tests, if we were to modify the partition layout via OTA there is a risk that devices will brick during the partitioning. We feel this poses too great a risk for our community of users, which is why we have decided not to implement Project Treble on current OnePlus devices

Chinese smartphone brand OnePlus was the first OEM to opt out of Project Treble for its current and last range of flagship devices on Android Nougat.

Nokia was the second company to make their hesitation with the project public, particularly when it comes to updating the current devices to Android Oreo that support the Project:

HMD is fully committed to implementing Project Treble on all new Android Oreo products in the near future, and we apologise for any disappointment this may cause.

Final Thoughts

It’s indeed a great time for Android app developers and users as Google is finally addressing one of the great annoyances with its, otherwise, versatile operating system. Project Treble means phones will have longer support cycles rather than just two years, which most flagships have today, although, at the end of the day, it will be up to the OEM’s discretion to issue or not to issue an upgrade.

About the Author

Shahid Mansuri Co-founded Peerbits, one of the leading Android mobile app development company USA, in 2011. His visionary leadership and flamboyant management style have yield fruitful results for the company. He believes in sharing his strong knowledge base with leaned concentration on entrepreneurship and business. Being an avid nature lover, he likes to flaunt his pajamas on beach during the vacations.

InfoQ Weekly Newsletter

Join a community of over 250 K senior developers by signing up for our newsletter. If you are based in the EEA, please contact us so we can provide you with the protections afforded to you under EEA protection laws.

InfoQ Weekly Newsletter

Join a community of over 250 K senior developers by signing up for our newsletter. If you are based in the EEA, please contact us so we can provide you with the protections afforded to you under EEA protection laws.

Is your profile up-to-date? Please take a moment to review and update.

Email Address

Note: If updating/changing your email, a validation request will be sent

Company name:

Keep current company name

Update Company name to:

Company role:

Keep current company role

Update company role to:

Company size:

Keep current company Size

Update company size to:

Country/Zone:

Keep current country/zone

Update country/zone to:

State/Province/Region:

Keep current state/province/region

Update state/province/region to:

Subscribe to our newsletter?

Subscribe to our architect newsletter?

Subscribe to our industry email notices?

By subscribing to this email, we may send you content based on your previous topic interests. See our privacy notice for details.

You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.