How Project Treble will speed up Android updates


There is not much time left before the official release of Android Q, so developers are working hard to update their applications for the new version of the most popular mobile operating system. While most devices haven't yet updated to Android 9 Pie (API level 28), the new mandatory API level requirements you've probably already heard about will force you to upgrade to API 29 in 2020.

If you have not yet updated your application to API 28 requirements, we recommend that you do so as soon as possible, as Google has given developers until August 2020 to update their in-development applications. And already released applications need to be updated before November 2020.

Project Treble

If you want to start developing an application for the next version of Android, you can already test your application using the Android Studio emulator, or a Google Pixel smartphone. This year, Google introduced another development called Project Treble , which will allow manufacturers to quickly release updates for applications on Android. You can install the official GSI build of Android Q on your device if it is compatible with Project Treble.

The essence of Project Treble is the modularity of the operating system , when the OS base is separated from the firmware installed on top of it. This will allow manufacturers to change only the OS base when new versions of Android are released, which will increase the speed of updates. In addition to the CTS tests that test applications, there is a new set of tests, VTS, or Vendor Test Suite.

VTS tests will allow manufacturers to check whether their devices meet Project Treble requirements. One of the most important details that device manufacturers need to check when the next update is released is the ability to download the GSI build on devices compatible with Project Treble. The GSI build is a pure version of Android that device manufacturers use to test for Project Treble support when releasing a new smartphone. However, Google wants developers to use GSI builds to test their apps for compatibility with the latest version of Android.

For example, if you have a Google Pixel smartphone, the only way to test your app on a future version of Android is to install the Android Studio emulator. You can also use a special cloud service for testing, or buy a Google Pixel smartphone.

Each of these methods has its advantages and disadvantages, but if you have a working device that is compatible with Project Treble and don't want to spend the money buying the full version of Android Studio to remove all the restrictions, why not install the GSI build to your device? If your app runs well on a GSI build, it will most likely run on all devices running that version of Android.

Android Q won't be open source until August 2020, so official GSI builds are the only way to test Android Q on smartphones that aren't part of the Pixel line of devices.

How Project Treble works

A visual explanation of how Android now works "inside"

Previously, each version of the operating system had a different set of commands and frameworks, which is why manufacturers of smartphones and mobile chipsets needed to rewrite all their software almost from scratch. Google approached this problem in the following way: from now on, Android, at its core, consists of two software layers that are in no way dependent on each other. That is, updating Android itself on devices supporting Project Treble will be handled by Google itself, and the task of updating proprietary software add-ons will fall on the shoulders of the manufacturer. In the future, this may completely eradicate the problem of delays in the release of Android updates for all devices.

Requirements

Before you start installing the Android Q beta, you need to check whether your device is compatible with Project Treble, and whether you can install a system image from the bootloader.

What should you do first?

  1. Unlock the bootloader if it is locked.8) Some Samsung smartphones on Snapdragon, Huawei, Honor, Nokia (except Nokia are not suitable.
  2. Your PC must have the latest utilities and . Using outdated versions of the Fastboot utility can lead to various errors.
  3. Your device must meet one of these criteria to support Project Treble:
      The device runs Android 9 Pie straight out of the box. If you bought a device with Android 9 Pie pre-installed, you can skip the next step.
  4. At launch, the device ran Android 8.0 or 8.1 Oreo, but has been updated to Android 9 Pie. Below we will tell you how to find out.

Before we proceed to the next step, we must warn you that when installing the GSI build, you will have to completely format your device. Therefore, make a backup of your data before taking any action.

Another important point is that all GSI builds do not pass CTS tests at the time of their release. Therefore, if your application uses the SafetyNet protocol to check the device for passing the CTS test, nothing will work. In addition, these builds are not recommended to be used on an ongoing basis, as they are full of various bugs. Google has published a list of currently known bugs in GSI builds on its website. If you discover new bugs, you can report this to Google by filling out the appropriate form (see Google Issue Tracker).

Android 10 is available for any Project Treble-enabled smartphone

Back in 2020, Google introduced Android Oreo and with it Project Treble as a revolutionary architecture that would forever solve the problem of fragmentation of Android smartphones, as a result of which a small percentage of devices received the latest update. Today is 2020, and fragmentation has not gone away, but do not rush to conclusions, Project Treble was still able to help firmware developers. Read our material to learn about the real prospects in terms of updates for your device.

Thanks to Project Treble, it has become possible to install firmware based on pure Android without making changes to the boot partition on the disk or to the partition of the smartphone manufacturer. Every manufacturer that has been certified by Google, or is about to become certified, is required to test their devices to meet Project Treble requirements. Manufacturers must ensure that an AOSP-based firmware image can successfully boot and run using the Treble architecture.

Does this mean there's a light at the end of the tunnel for many Android smartphones?

Project Treble has brought a boom in the field of custom firmware, which is being done by independent developers, such as those from the XDA Developers forum. For thousands and thousands of smartphones every day, a huge number of third-party firmwares are created that use the Treble architecture to ensure that the latest versions of Android appear even on those smartphones that are no longer supported by the manufacturer. The news is that the Phhusson development team managed to present the first custom image of Android 10 to any device that supports the architecture described above.

If you have a fairly popular device in your hands right now and you are interested in the issue of custom firmware, then you have nothing to worry about - they always create a lot of firmware for such smartphones, giving you the right to choose. But if your phone is not that popular, and developers are not interested in creating firmware for it, then Project Treble will be the most relevant opportunity for you to upgrade to Android 10.

Fortunately, Phhusson's firmware image will boot on any device running Project Treble, and in fact, all smartphones released with Android 8.0+ out of the box. For this reason, if you are the owner of even a little-known smartphone based on a MediaTek processor, you can still try your luck by installing the firmware from this development team.

You can buy a smartphone with Project Treble support in the Xiaomi Rumikom brand store

Write in the comments if you would be interested in material on how to do this - if there are enough of them, we will write instructions for you very soon.

Checking compatibility with Project Treble

Open a console on your computer and enter the following command:

adb shell getprop ro.treble.enabled

If the response is false , then your device is not compatible with Project Treble. So you don't have to continue any further. If the answer is true , go to the next step.

Then enter these commands:

adb shell cat /system/etc/ld.config.28.txt | grep -A 20 “\[vendor\]”

In the response you receive, you need to find the [ vendor ] , and inside this section, find the namespace . default . isolated . If the opposite value is true , then you can install GSI-side on top of the Android 9 Pie image on your device. If the value is false , then you can install the GSI assembly only of the version that is currently installed on your device.

How it should look using the example of OnePlus 6T

Now you need to confirm if your device is rooted. If your device has been updated to Android 9 Pie, rooting is not necessary, but it is required to support OTA updates. Enter the following commands to check if your device is rooted:

adb shell cat /proc/mounts | grep -q /dev/root && echo “system-as-root” || echo “non-system-as-root”

Now that you've verified that your device supports Project Treble, you'll need to figure out which version of the GSI build to download, as there are different images for different architectures. Enter the following command to find out what architecture your device is using:

adb shell getprop ro.product.cpu.abi

Write down the information you received on a piece of paper: you will need it when downloading the GSI assembly.

Consequences of Project Treble

From the user's point of view, OS updates will arrive exactly the same as now. Companies will still be able to forward OTA updates that you can download in the background. The only thing is that this process will happen a little faster, and the device support period will also increase.

Thanks to Project Treble, custom firmware developers will be able to optimize the OS for a specific smartphone much faster. If earlier this took weeks or even months, now all this can be done in a couple of days.

Most XDA users are already excited about the prospects. The developer under the nickname "OldDroid" called it a breakthrough. He managed to install custom Android Oreo firmware on Huawei Mate 9, for which there was no third-party Android Nougat firmware available at all.

We may be approaching a time when Android OS software can be easily ported to different devices, much like Windows can run a huge range of hardware configurations with minimal requirements. But that's not the goal of Project Treble at the moment.

Download the GSI assembly

Links to download official GSI builds of Android Q are available on the official website. You need to download the appropriate version, depending on the device architecture, which we learned from the previous step. The download may take a long time if you chose a build with Google mobile services. We recommend downloading this option, since you can test your application immediately with Google services installed.

Once the file is downloaded, unzip it. There should be 2 files inside: system . img and vbmeta . img .

Why is Project Treble needed?

Many criticize Android due to the fact that most high-end devices still run on an outdated operating system, while even the very old iPhone 5S received an update to iOS 11. All this criticism is partly unfounded. After all, Apple makes its operating system only for the iPhone, and Google for a large number of other manufacturers.

But since smartphones are acquiring an increasingly important role in a person’s life: storing a huge amount of personal data, financial details, photos, etc., therefore, receiving the latest security patches and the latest OS updates is very important.

The slow update problem stems from the Android software slots interacting with the phone's underlying hardware. In order for applications to run on the processor or use the camera, the OS must communicate with the connected hardware through a hardware abstraction layer (HAL).

This is very important, especially if you want third-party apps from the Play Store to interact with any phone's camera. HALs are designed to be low-level driver-agnostic. Below that is the Linux kernel, which handles the hardware communication between the HAL and the exact components of the phone. It must be compiled depending on the specific hardware of the smartphone.

The problem with Android 7.0 Nougat and older versions is that there was no separation between the manufacturers' low-level hardware code and the higher-level AOSP operating system code. Therefore, companies had to wait until each processor manufacturer optimized the new OS, and only then the companies themselves modified them for their smartphones.

Project Treble is designed to solve exactly this problem. It will be able to decouple the Android OS from the vendor's hardware code implementation, allowing Google and OEMs to update the OS without having to reconfigure all the underlying hardware components.

It is clear that all manufacturers want to add more of their new features to the OS. And all this takes a lot of time, even despite the presence of Project Treble. But, in any case, with this structure, updates will come out faster, because... the time for optimizing the OS will be reduced several times.

Installing the GSI assembly

  1. Reboot the device bootloader using the following command: adb reboot bootloader
  2. Next we need to disable Android Verified Boot (AVB). Enter the following command: fastboot flash vbmeta vbmeta.img
  3. Format the system: fastboot erase system
  4. Now you can start installing the GSI build of Android Q: fastboot flash system system.img
  5. Once the installation is complete, delete user data: fastboot -w
  6. Reboot the device: fastboot reboot

That's all, the next time you start the smartphone, it should start with the GSI assembly installed. It is worth noting that Android Q beta 2 GSI cannot be installed on OnePlus 6T, but it can be installed on Xiaomi Mi 9. Write your thoughts about the new Android Q in the comments.

How the situation with Project Treble will change

The project will change the scheme for receiving updates, where there are no intermediate links. Currently, the system is a single structure, where updating requires rewriting most of the code. In Treble, the firmware consists of several modules.

To update, the electronics manufacturer only needs to attach its own shell to the firmware and check compatibility with the hardware components. There is no need to wait for driver updates, since the system will work correctly on the existing drivers and the version of the Linux kernel with which the mobile device entered the market.

In addition, Google is establishing work with component suppliers to include some of the closed drivers in the main base of the operating system. Thanks to this, the process of releasing a new version of Android will become easier, and some software components and graphics drivers will be updated via Google Play!

Project Treble is the solution

The reason why manufacturers have trouble releasing an update quickly is because the operating system needs to communicate with the hardware.

Traditionally, it worked something like this: the OS and the underlying software were part of the same code. Therefore, when the OS was updated, this low-level software, technically referred to as a Vendor implementation, also had to be updated. It's a lot of work.

Android fragmentation is a problem

One of the biggest problems with Android as an operating system is what is commonly called "fragmentation." The traditional definition is "the process of breaking down into small or discrete parts", which is directly reflected in Android: there are eight different versions of Android currently, which are still used on different types of hardware.

The standard here is, of course, set by Apple with the iPhone. The most common version of Android is almost two years old - Android 7.x (Nougat), with almost three-quarters of all iOS devices running the latest version (iOS 11).

That compares to 28.1% of phones running Android 6.x (Marshmallow) and 28.5% running Android 7.x (Nougat), meaning more than half of Android phones are running the OS from two years ago. A meager 1.1 percent runs the latest version of Android 8.x (Oreo). To put it more bluntly, over 98 percent of Android devices are running outdated software—over 36 percent are running five-year-old (or older) software.

Unfortunately, there are many reasons for this, but they can generally be attributed to two key issues: manufacturers and Google's update cycle.

Rating
( 2 ratings, average 4.5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]