Here on XDA, we have previously talked about Project Treble, the largest low-level change introduced to the Android base since the first Android beta was released almost 10 years ago, and how you can tell if your device has it. For those still unaware of what Project Treble is, it modularizes the lower layer of Android by separating the vendor implementation (proprietary blobs and software, CPU and GPU drivers, et cetera) from the main Android framework and system. This results in speeding up system updates by modularizing the hardware abstraction layer (HALs) and separating it from the rest of the Android OS, and by eliminating OEM dependency on slow driver updates by silicon manufacturers. The end goal is to hopefully lengthen the 24-month major software update support period currently promised by most device manufacturers.

This should help give Android phones the ability to receive Apple-like updates, at least on flagship phones. While the average Android flagship receives 2 major updates in a 24 month period, iPhone devices get a minimum of 4 years of iOS updates, including minor ones. On Treble-supported Android phones, this can eventually become a reality, assuming the phone manufacturer is down to update their phone. Those who want to keep their devices up to date during a similar time frame have no other option but to resort to custom ROMs.

Luckily, Project Treble should also make the grass greener for custom ROM users as well. In fact, it has the potential to change the custom ROM development scene completely - and for good.


How can custom ROMs take advantage of Treble?

lineageos

The reason why unofficial Android Oreo ports are slowly being worked on rather than just something developers can compile, boot up, and run is simple. In order to bring up a new Android version on an existing device, the kernel and the device tree need to be heavily reworked in order to make an existing Android phone work with a newer Android release. That's because the current vendor implementation, including all proprietary binary blobs, is made to work with a single Android version, and thus need to be reworked and ported to the new Android version for the device to work properly.

Almost all components inside the phone use an independent, proprietary blob, and requires to be patched and worked on independently so that the newer software can use it, also making sure the other ones don't break in the process. This is truly a time-consuming task, and the main reason why most stable custom ROMs (like LineageOS weeklies or other, officially supported ROMs) don't appear until 2-3 months after the final Android release drops to AOSP. All this effort also means that the resulting ROM will only work on one device or, in the best case, a handful of identically or similarly specification devices.

This seems to be changing with Project Treble, according to Ron Amadeo of ArsTechnica and independently corroborated by custom ROM developer SultanXDA.

Malchev says that Treble standardizes Android hardware support to such a degree that generic Android builds compiled from AOSP can boot and run on every Treble device. In fact, these "raw AOSP" builds are what will be used for some of the CTS testing Google requires all Android OEMs to pass in order to license the Google apps—it's not just that things should work, they are required to work.

To drive this point home, it means that because of the way the lower layer of Android was modularized, all Treble devices in the market will be able to boot a generic stock, AOSP Android build. This takes away most of the hassle of porting custom ROMs to an older device since a single, generic Android build can run on many devices. This moves Android devices way closer to something like a personal computer, where you can boot up the latest, cutting edge Windows 10 build or any Linux distribution on a 10-12-year-old computer.

You won't be able to boot up flawlessly-working generic Android 9.0 builds on your Treble device just yet, though - device trees and kernels will still require being worked on. It's still a great start: thanks to the modularized HALs, the workload for bringing up the next Android version should be greatly reduced, and we could see stable 9.0 builds in a matter of days/weeks instead of months. We should have in mind that Project Treble, while it's now rolling out, is still a work in progress as it's still receiving changes in AOSP, and the vendor layer could eventually be standardized to the point installing a new Android version will be the same as installing Windows on a computer.

This is a huge technical advancement, and it has the potential to significantly improve AOSP-based custom ROM development on our forums. But then, this only applies to devices with Project Treble, and currently the only Treble phones available out there are the Google Pixel, Google Pixel XL, Sony Xperia XZ1, and XZ1 Compact. What will happen to existing, pre-Oreo phones?


Could a custom ROM bring Treble to an existing phone?

We've already had quite the catalog of Android Oreo ROMs for existing phones, including Nexus, OnePlus, Xiaomi, and Motorola phones. However, could one of these ROMs bring Project Treble to your phone? The answer: it's not likely.

The changes made to the low-level platform of Android are really complicated, and not really something you can just get working on a regular custom ROM. It's not something like pie controls or device gestures, but a total redesign of the vendor implementation. This is something that requires the work of Qualcomm and other silicon makers to be on board. Google is currently working with different OEMs to bring Treble to some existing flagship phones, but even then, we are not sure what OEMs are working on it since the list was not disclosed. However, we have seen some Treble-related commits floating around in the LineageOS Gerrit, so it's safe to say that it is indeed being attempted.

In the end, it's too early to tell. We have seen some amazing development feats coming from our forums before, including awesome stuff like universal systemless interfaces or eMMC storage upgrades, so who knows? Someone might somehow end up getting Project Treble working on a legacy phone.

But we've only had the chance to dig through the Android Oreo source for roughly 2 weeks so as we said, it's still too early to tell. We are still excited about the possibilities, though, and we'll keep you informed about future Treble-related developments on the XDA Portal, which is best accessed through the XDA Labs app!

Thanks to Paranoid Android team member /u/evan1123 for clearing up a mistake in the article!