Running Android 9 (Pie) on a Nexus 5 -- Unlegacy Android

2019-04-24 - Louis-Philippe Véronneau

Like most good stories, this one starts in a bar with friends. I had the chance to go to FOSDEM this year and I managed to get a bunch of people from the DebConf videoteam to meet me at Brew Dog Bruxelles.

Like the respectable geeks we are, the first thing we did after exchanging greeting was to connect to the local Wi-Fi. That's when Stefano Rivera looked at my phone and casually said: “Wow, that's running Android 7, it's ancient!”.

I've had my Nexus 5 for a while now. If I recall correctly, I bought it sometime in Q1 2014. Although already dated at the time, it was a great phone: fast, cheap and easy to repair. The Nexus 5 hasn't been supported by Google for years, but until recently LineageOS did a great job at keeping the OS patched and updated. Sadly, it seems my device won't get ported to LineageOS 16. As announced here, the 14.1 branch won't get security support anymore.

Lucky for me, I found the amazing Unlegacy Android project. Their goal is to build and patch the Android Open Source Project (AOSP) for older devices. The difference with LineageOS is that they do not customize the ROMs, thus making patch porting easier and less troublesome. A few models are supported, but their main focus is the Nexus 5.

Installing Unlegacy Android

If you have a Nexus 5 and want to upgrade to a bleeding edge version of Android, you have two options:

  1. You can install one of the builds provided by the Unlegacy Android project. Since they still consider Android 9 experimental (even though it works pretty much flawlessly), those builds are hosted on a shady cloud storage.
  2. You can build the ROM yourself, following the LineageOS wiki instruction while replacing the code repository with the Unlegacy one.

Although it's a bit more work, I prefer to build the project myself. Something about downloading an update from a random cloud storage doesn't feel right to me. Once a month, when the monthly Android Security Patch is merged in the Unlegacy repository, I boot a VM on my server and build a new OTA update.

Unlegacy Android also provides official Android 7 and Android 8 builds if you are into that.

What about bugs?

I've been using Unlegacy Android with the latest Android 9 builds for 3 months now and the only bugs I've experienced are:

  • On an encrypted device, TWRP isn't able to decrypt the partitions, rendering it somewhat useless. You can still update the device via ADB sideload though.
  • Bluetooth voice calls (HFP) are garbled. Playing music via A2DP works fine though.

I also seen more random app crashes than when I was using LineageOS 14.1, but nothing extreme. The overall experience is great: my device is snappy, runs the latest AOSP build and I neither have bloatware nor Google Apps.

All in all, considering new phones running Android 9 start at 500 USD and that you can buy a new Nexus 5 for less than 100 USD on ebay, it's a pretty compelling choice.