Ever since the announcement of Project Treble a week before Google I/O, users have been clamoring to check which devices would be Treble certified. After my report about the benefits that Project Treble support brings to AOSP-based custom ROM development, there was renewed interest in pushing device makers to have their devices be Treble certified with an upgrade to Android Oreo. We have received some requests from users to feature the popular petition going around which requests that OnePlus support Project Treble on their devices, however, we declined to do so because we felt it was an unreasonable request. Here’s why current OnePlus (and Nokia) smartphones won’t be Project Treble certified.

As I explained in my previous article, the gist of how Project Treble works is that all of the vendor-specific code is separated from the Android OS framework into its own separate partition. What that means is that the Hardware Abstraction Layers (HALs) that interface with the device’s hardware are no longer found alongside the OS framework code. Instead, they are moved to a separate vendor partition without having to be recompiled, and new standardized vendor interfaces (defined with HAL Interface Definition Language) allow for the OS framework to communicate with the HALs.

This allows for the Android OS framework to be upgraded without having to recompile the HALs, cutting down on the time it takes for device makers to start porting their code to the new Android version. So how can Huawei phones upgrading to Oreo meet Project Treble requirements while OnePlus and Nokia can’t?

Project Treble and the Vendor Partition

The problem has to do with partitions, or rather, the lack of one—the vendor partition. On devices such as the OnePlus 3/3T and OnePlus 5/5T, the vendor code is located in /system/vendor which is a part of the system partition. On the other hand, Huawei, Essential, and Google phones have already been using a vendor partition to store vendor code on their devices.

Honor V10 Vendor Partition

Project Treble compatibility requires that a device ship with a separate vendor partition in order to store the vendor HALs. The screenshot above shows a dump of the /vendor partition from the Honor V10, a device which ships with Android 8.0 Oreo and is required to meet Treble’s requirements. Since existing OnePlus and Nokia phones lack a vendor partition, it means there is no reason for them to work to meet Treble’s requirements when upgrading their devices to Android Oreo.

That doesn’t mean it is impossible for them to add a vendor partition, but it can be risky. Since these devices already ship without a separate vendor partition, it means that they would have to re-partition existing devices to include space for the vendor partition. This is possible to do, but there is always a remote chance of unrecoverable data loss in the chance something goes wrong. For the average person, the chance is small that a device may be bricked during re-partitioning. However, multiply that chance by hundreds of thousands or millions of users re-partitioning their devices, and that’s a risk that device makers like OnePlus or Nokia can’t afford to make.

But keep in mind that Project Treble support isn’t a requirement for a device to have great software support. After all, the Nokia 8 received Android Oreo very recently and so did the OnePlus 3/3T and the OnePlus 5. Project Treble absolutely makes updating their phones easier for the device maker, but that doesn’t mean without supporting it these companies will be slow at updating their phones.

As for why device makers like OnePlus or Nokia never implemented a separate vendor partition, it’s because it just wasn’t a requirement for them to do so until Android Oreo. Some would argue why the recently released OnePlus 5T didn’t launch with Oreo or have a separate vendor partition, and while I can’t say for sure why, my best guess is they built the software as close to the OnePlus 5 as possible so they could release unified builds like they do for the OnePlus 3/3T.

Are there other ways to implement Project Treble support? phhusson believes it may be possible for the system partition to itself be gpt-partitioned so it can contain both the system and vendor partitions. Doing this may meet Google’s expectations of needing system/vendor/odm/factory/oem partitions. Although this would remove space from the existing system partition, phhusson suggests that the new vendor partition use SquashFS to optimize space. Now, this is merely a proof-of-concept workaround, but it’s one possibility that phhusson believes may work in bringing Treble support to devices that lack a vendor partition.

To keep up to date with Project Treble related news, check out our new Project Treble development forum. We will also be covering any new Treble-related developments that crop up given the excitement it has generated for our readers. We recommend you use the XDA Labs app to browse the forums and keep up to date with the XDA Portal for the latest news on Treble.

About Author

Long-time Android enthusiast starting from all the way back to the Sprint HTC Hero. Partial to the Nexus line, but open to try anything with Android on it. XDA’s resident master of everything Tasker.
Please direct media inquiries to mishaal@xda-developers.com

XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality.Are you a developer? | Terms of Service