LightBlog

jeudi 23 novembre 2017

I Booted Stock Android Oreo on the Huawei Mate 9 thanks to Project Treble

Just a week before this year’s Google I/O, Google unveiled one of the most fundamental, low-level changes to the Android OS framework: Project Treble. Project Treble modularizes the Android OS framework to separate it from vendor code, allowing OEMs to work on new software updates without having to wait for vendors (like Qualcomm) to update their code. As part of the Vendor Test Suite (VTS), all Treble-enabled devices must be able to boot a raw, generic AOSP build. Project Treble support is required on any device shipping with Android Oreo, so even though there are several devices that meet this criteria, nobody has tested whether or not we really can just boot a ROM compiled straight from source. But finally, I was able to boot a stock, generic AOSP-built Android 8.0 Oreo ROM on the Huawei Mate 9 thanks to Project Treble support.

Android Oreo Project Treble Android Oreo Project Treble Android Oreo Project Treble Android Oreo Project Treble

What you’re seeing above are screenshots of AOSP Android 8.0 Oreo running on the Huawei Mate 9. The Huawei Mate 9 was launched last year with Android 7.0 Nougat on board. In particular, it runs a custom skin called Emotion UI on top. Its software is incredibly different compared to what you might find on one of the Google Pixel phones.

Currently, there’s no publicly available Android 8.0 Oreo builds for the device. One of the leaked Android Oreo builds we obtained early last month revealed that Huawei was indeed working to meet Project Treble’s requirements even though it didn’t launch with Android 8.0. The Mate 9’s software being so far different from stock Android made it a perfect candidate for testing if Project Treble truly does allow us to boot stock Android Oreo onto any Treble-enabled device.

Booting Stock Android Oreo on Project Treble-Enabled Devices

Recently, a member on our Essential Phone forums posted a thread to see if their phone could boot a generic AOSP Oreo build. The Essential Phone itself had just received its first official beta build of Android 8.0 with Project Treble support, so it seemed plausible. XDA Senior Member phhusson, best known for his work on an open source superuser fork, was up for the challenge. Since the raw AOSP build that Google shares with OEMs for certification purposes is not public, phhusson had to build his own generic AOSP image and find testers to try it on their devices.

Though progress was made, nobody had yet successfully booted the AOSP build onto their Essential Phone. I decided to give it a try on my Huawei Mate 9, which fully meets Project Treble’s requirements. Since Android Oreo isn’t public on the Mate 9, I used the FunkyHuawei.club service to update the firmware on the Mate 9 to the closed beta build of Oreo.

Huawei Mate 9 Project Treble

Snippet from /vendor/manifest.xml on the Mate 9

After a lot of userdata partition wipes, system image flashes, and log dumping, we finally booted the generic 8.0 build onto the Mate 9. We didn’t make a single kernel modification to get this to boot either. Not only is this the first time that a Huawei Mate 9 device booted an AOSP ROM, but it’s also the first time someone outside of Google and OEMs has tested whether Project Treble-enabled devices really can boot generic AOSP builds.

Before you get too excited, though, the build is not perfect yet. A bunch of apps crash right now likely due to some error with decryption, but with a bit of work I’m sure that can be fixed. Just the fact that AOSP 8.0 Oreo boots on the Huawei Mate 9 of all devices is a marvel in and of itself. We’ll be refining this work and seeking input from developers once our new Project Treble Device Development forum opens up, so if you’re interested in this kind of development then stay tuned for news on that front.

Conclusion

There has been a lot of speculation about how much Project Treble would help speed up software updates on smartphones. The current process through which an OEM rolls out a software update is quite lengthy, and while it would be nice for Treble to speed this up we haven’t seen that happen yet. That makes sense, though, since there are only a handful of devices with Project Treble support and it will take until the release of Android P for us to really see Treble’s benefits on the Android ecosystem as a whole.

But thanks to Project Treble’s certification testing requirements, device makers are required to ship devices that can boot a generic AOSP build. Until today, nobody had tested whether or not that was possible right now on existing Treble-enabled devices. However, now that we’ve proven this possibility exists on the Huawei Mate 9, we hope to open the floodgates on custom ROM development based around Treble-enabled devices.



from xda-developers http://ift.tt/2B5SIlt
via IFTTT

Aucun commentaire:

Enregistrer un commentaire