Felix Elsner

Android Projects

I've compiled a small list of my contributions below to give you an idea of what a (hobbyist) Android system developer might be working on. There are many people who put in much more effort and achieve tremendous results, and I have great admiration for them. Having first-hand experience with leading groups, good and bad, I'm happy to stay in the background in Android matters.

Why do this at all?

I like coordinating with others, distributing work and responsibilities, testing and tinkering, setting up build systems and building new tools where needed.

Working together in a team, helping newcomers and discussing interesting architectural challenges is what motivates all of us to give our sparse spare time.

It's great to open your inbox and get mail from all over the world, either with questions or often just a small thank you for helping someone out. I'd wager that I've helped at least a few dozen people get started with Android systems development, and many more passers-by with a specific problem.

Selected projects

AOSP builds and development for Sony devices

The Sony Open Devices Project (“SODP”) is very unique. We strive to create as much open-source components as possible. As opposed to other vendors - who turn a blind eye but could shut down custom ROM projects any time - the work happens with full legal backing from Sony Mobile.

In regognition of my contributions, Sony named me "Hero Open Source Developer" in 2019.

Build and Project Work Contributions to SODP itself

Upstream contributions

I contribute to the Google-led Android Open Source Project (AOSP), OmniROM, LineageOS and many more. It's pretty fun to type your email into GitHub search and see how many hundreds of projects all have your changes.

If you have a device running Android 10 or higher, you already have some of my changes inside!

AOSP Gerrit: LineageOS Gerrit:

It can take months and tens of revisions to get a change accepted into AOSP. But it is quite rewarding to have your code running on potentially billions of devices!

Android articles

I try to document as much of our work as possible so that we have a working form of knowledge management.

The knowledge base is accessible at Open Devices Corner, generated via the Hugo static site generator, using a forked jeblister/kube theme.

There is a Documentation section with more in-depth articles but also some references like an overview of all currently supported devices, and a Developer Diary section where smaller and day-to-day findings are noted down.

Sample selection

One big issue is handling confidential information. Before any post goes public, it has to be cleared with the people whose work is mentioned, and anything touching non-public information and closed-source components has to have Sony eyes on it before release.

“Project Treble”-enabled AOSP builds

Project Treble is an initiative to allow vendors to more easily keep their devices updated with the latest Android versions, and thus keep their users secure. The device maker provides low-level interfaces from which the Android "system" can run, sort of like a container ship accepting any spec-conforming container. For more information, see this ArsTechnica article.

Thanks to my contributions, SODP devices can run GSIs flawlessly, and my Treble builds allowed for running Android Q on the Xperia XZ on the day the first public GSI of Android Q was released.

Sample commits

Community Page

Part of the success of a great open source project is reaching new users and contributors. For that purpose, and because the official Sony pages tended not to be very inviting or were out of date, I set up a community page to encourage people to learn more about Open Devices. It acts as a central landing page for all people interested in the project and motivates them to actively participate.

The site is available at Open Devices Community Page and offers visitors the opportunity to discover builds for their devices, helps and encourages them to build AOSP for themselves and join the project, links to sister projects and guides people throughout the whole SODP ecosystem.

Key points of interest:

SailfishOS for Xperia XZ

It was a lot of hard work figuring out the byzantine structure of the Sailfish project, but I managed to develop a working port for the Xperia XZ. The build system is not really aimed at hobbyists, but rather at vendors.

Instructions at sx.ix5.org: SailfishOS Installation on Xperia XZ.

Version: 3.0.1.11, using AOSP 8.1 and Kernel 4.4 as a base.
RIL, mobile data, bluetooth, sound, camera, sensors, video acceleration - all working.

@Rinigus has ported SailfishOS to Tama devices based on Android Pie with Kernel 4.9, see sailfishos-sony-tama.

SELinux policy

Broadly speaking, SELinux policy is a mechanism to describe what programs are to be allowed which sets of actions. It helps make a lot of vulnerabilities less exploitable, but a bit of work is involved to observe and decide which actions are really necessary.

I got the SODP sepolicy ready for Android Pie, and subsequently Android 10. There were some dirty hacks and lots of mistakes in the process, but it is in a good state now.

SailfishOS documentation at foresail

Available at sx.ix5.org/foresail.

An effort to improve the horrendous documentation available for SailfishOS builders. Tries to cover Sailfish, mer, mer-hybris, halium, Android parts, Sailfish build tools and more.

Using a customized sphinx theme that resembles the "Just the Docs" jekyll theme.

SailfishOS upstream & Halium

Various commits. I've used marina-bay as an organization to gather repos for a quick Xperia XZ SailfishOS port.

I've dabbled with Halium and Ubuntu Touch, but sadly they're based on ancient Android versions which we do not support any more.

LineageOS test builds

For testing, I built and distributed unofficial LineageOS test builds.

I've used afstamming as an organization to gather repos for an Xperia XZ LineageOS port.

repo_update

At SODP we try not to maintain forks of upstream repositories, we rather use a script to patch them. This saves resoures (less time wasted with merges) and explicitly helps keep track of what we've patched.

I made the script more accessible to newcomers and contributed a patch to allow developers to work fully offline, re-using downloaded data.

Health HAL

Lots of times, you need to write glue code to bridge layers of abstractions. I wrote a health HAL that reports battery and storage status to the higher layers in a HIDL-standardized way over the binder protocol.

With persistent storage for battery wear, measured in cycles and drop in capacity.

Universal Dual-SIM patcher for Sony devices

Saves bandwidth and storage by only having to create one build for both single- and dual-SIM devices.

Download and discussion at the Dual-SIM information page.

Big thanks to @oshmoun for the regex crafting!

New Android version bringsups

Commits that fix compatibility with newer revisions of Android.

Android 10 bringup Android 11 bringup

Other Commits across SODP

These don't fit in anywhere else:

All pull requests by me: author:ix5.

Debloating scripts for Stock Oreo

Credits to the AROMA creator and @korom42 for creating the base Stock Light ROM Patch.

Available for Xperia XZ on .184 and .192 stock firmware.

Download: lightpatch-v7.3-slim-hero.zip

DSP label fixer

This patcher was not really needed anymore after the Pie release, but was a nice quick exercise getting to know the edify language on Oreo.

For an explanation, see the post DSP file relabling for SODP.

Download: dsp-label-fixer.zip

Closing

There are people way more talented and engaged than me - numerous device and ROM maintainers and system architects, people keeping ancient devices alive, debugging, reverse-engineering, writing probing tools and coming up with insane workarounds, coordinating and teaching.

A small, non-exhaustive list:

For people looking to delve into this world, I say you can learn a lot by observing the work of others; veterans enjoy helping motivated newcomers, but make sure to do your homework! It is also crucial to understand what you are doing, and why. Don't just mindlessly copy and pray something works.