Mobile 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- Feature and bug list management
- Policing issue tracker, triage
- Changelog and SODP-wide security bulletin
- Merging and testing of security patches
- Support at xda-developers, maintaining chat support groups
- Introducing and teaching new developers
- Treble compatibility
- SELinux policy (see down below)
- Restructuring, getting the device trees in orderly shape for faster iteration
- Improving the
repo_update.sh
script - Kernel commits
- Adaptation to newer Android releases
- Tweaking performance settings and improving reliablitiy
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:- packages/apps/Camera2: Rework permissions request flow ← major
- hardware/interfaces: Add interface info to .rc files ← major
- system/core: ld.config: Permit legacy /system/vendor paths
- build: soong_config: Include BOARD_VENDOR_SEPOLICY_DIRS
- build: fs_config: Fix cases without vendor/oem partition
- build: core/main: Strip bitness before existence check
- system/sepolicy: file_contexts: Include legacy /system/vendor paths
- hardware/interfaces: health: Add CAP_WAKE_ALARM to service
- packages/apps/Camera2: Dismiss keyguard when opening settings
- frameworks/base: topic: Add camera button long-press handling (pending)
- Expose Camera Lift Trigger in Gesture Settings: New setting, fwb: Enum, test coverage (pending)
- sepolicy+build+soong: topic: Support BOARD_SYSTEM_EXT* sepolicy
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- Building Android - The quintessential Open Devices intro
- Build Structure
- Security - Explaining some Android security concepts
- GPS HAL Adaptation - Porting log, helpful for would-be device maintainers
- Android Q: Compiling Kernels in-tree
- Android Q Changes
- Bluetooth Audio Debugging
- Debugging DAC_OVERRIDE
- Android Kernel Suspend Debugging and Tracing
- Debugging suspend ideas
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.
- Releases for Xperia XZ, XZs and Xperia X
- For a more technical explanation, read the Fake Treble for Xperia XZ article.
- Credit goes to @sjllls for the initial idea and implementation. I am using re-packaged oem binaries into a combined vendor and oem image, while sjllls re-purposes the cache partition as a vendor partition.
- Based on my work, people have started work on independent suzu builds, see the @suzu-treble project
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- device-sony-common: init: Update vendor services
- hardware-qcom-wlan: wcnss_service: Drop vendor build guard
- ExtendedSettings: Declare as PROPRIETARY_MODULE
- ExtendedSettings: adb & DRS: Use vendor-prefixed "compatible" props
- device-sony-common: common: Force split sepolicy on all shippping APIs
- device-sony-common: common.mk: Force split props for all devices
- device-sony-common: common: Simplify treble buildvars, add VNDK pkg
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:- Device chooser
- Developer Introduction for (would-be) builders
- Builds section with ready-made builds, to encourage users to try free/libre software before diving in themselves
- Guides & Resources with further information
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.
- Vendor updates for Pie: ipacm, (vendor_)init, file labeling, misc
- PeripheralManager: Re-label as non-vendor type (temporarily), fix denials
- Vendor updates for Pie: Bluetooth, own domain for SODP apps
- Vendor updates for Pie: Sensors, Wi-Fi, properties
- PeripheralManager: Re-label as non-vendor type
- vendor_init: Fix /mnt/vendor/persist/ labels
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
Various commits. I've used marina-bay as an organization to gather repos for a quick Xperia XZ SailfishOS port.
- sailfishos/sdk-setup: sdk-manage: Compare snapshot to recent uninstalled
- mer-hybris/droid-hal-device: Rework buildmw() to use named arguments
- mer-hybris/droid-hal-device: helpers: Try to use $HABUILD_DEVICE for droidmedia and audioflingerglue
- mer-hybris/droid-hal-device: Add build_bootimg helper script (even featured in a Thesis...)
- mer-hybris/droid-hal-device: Omit droidmedia+audioflingerglue from libexec
Ubuntu Touch & Halium
Ubuntu Touch and the whole ubports project are great to work with. A vibrant and friendly community with a great focus on users. I've contributed to the installer and various other parts.
- ubports-installer: plugins: manual_download: Resolve copyFile promise
- installer-configs: v1/v2: dora,kagura: Add oem steps, cleanup
- devices.ubuntu-touch.io: Add kagura, kugo
Ubuntu Touch runs atop the Halium project, to which I've also contributed.
- halium/hybris-boot: fixup-mountpoints: Add Sony Xperia XZ (kagura)
- halium docs: porting: system-errors: Add bison 32-bit section
- halium manifests: prebuilts/tools: Set clone-depth=1
LineageOS contribs & 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.
LineageOS Gerrit:- android_build: check_boot_jars: Add CAF IMS to whitelist
- … and all the other contributions that get merged from AOSP, see author:Felix.
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!
ODM Version Checker
Contributed to ODMVersionCheck,
a small app for SODP which ensures the Software Binaries flashed to the odm
partition
are always up to date.
New Android version bringsups
Commits that fix compatibility with newer revisions of Android.
Android 10 bringup- device-sony-sepolicy: Q compatibility and cleanup
- device-sony-common: Power: Add interface info to .rc
- device-sony-common: Change toybox run context, update selinux xattr
- device-sony-common: Move kernel includes to common.mk
- device-sony-common: common: Set BUILD_RECOVERY_IMAGE true
- repo_update: Update for Android Q/master, see also AOSP Gerrit: sodp-q-compat
- repo_update: fwb: Add ro.system fingerprint patch
- vendor-qcom-opensource-core-utils: fwk-detect: Drop libnativehelper includes
- device-sony-common: treewide: Replace COPY_HEADERS
- device-sony-common: Explicitly enable traditional boot.img
- device-sony-common: packages: Add protobuf vendorcompat lib
- device-sony-common: rootdir: usb.rc: Drop load_system_props
- device-sony-common: common-prop: Sync SurfaceFlinger props
- vendor-sony-oss-cash: Android.mk: Replace LOCAL_COPY_HEADERS
- local_manifests: qcom: Update CAF telephony to LA.UM.8.2.1.r1
Other Commits across SODP
These don't fit in anywhere else:
- vendor-sony-oss-cash: cash_input_common: Properly close threads
- kernel: [2.3.2.r1.4] tone: dts: Convert i2c_3 GPIOs to pinctrl
- kernel: [2.3.2.r1.4] dts: tone: Set sound gpio to low by default
- kernel: [2.3.2.r1.4] msm-jpegdma: Add V4L2_CAP_DEVICE_CAPS to caps
- kernel: [7.1.r1] Android.mk: 4.14 SOMC_KERNEL_VERSION guard
- kernel: [2.3.2.r1.4] dts: tone: Fix gpio_11 to 12 in somc_pinctrl_pmic
- kernel: (picked) [7.1.r1] dts: lilac: Add missing battery profiles
- kernel: (picked) fs: Improve eventpoll logging to stop indicting timerfd
- kernel: (picked) [2.3.2.1.r1.4] arm64: DT: Tone: Fix custom mapping for PM(I)8994 MPPs
- kernel: (picked) [LE.UM.2.3.2.r1.4] [SECURITY] perf: core: Avoid race condition when releasing perf-events
- kernel: (picked) [2.3.2.r1.4] msm: kgsl: Three patches from the Feb Android bulletin
- kernel: (picked) [7.1.r1] arm64: vdso32: Use full path to Clang instead of relying on PATH
- kernel-defconfig: [LA.UM.7.1.r1] base_msm8956: Enable MSMB_CAMERA
- kernel-techpack-audio: [LA.UM.7.1.r1] Kconfig: AVTIMER_LEGACY dep on MSMB_CAMERA AVTIMER
- kernel-defconfig: [LA.UM.7.1.r1] base_msm8996: Enable MSMB_CAMERA
- device-sony-common: init: Boot DSP before SLPI again
- device-sony-common: init: Enable adsprpcd instead of starting
- device-sony-common: init: Force restorecon for /mnt/vendor/persist
- device-sony-common: common-perm: Remove obsolete extension perm xml
- device-sony-tone: init: Limit MTP rx/tx buffers to 16384
- device-sony-common: vintf: Align NFC
- device-sony-common: tftp_symlinks: Use updated persist and fw targets
- device-sony-common: General cleanup
- QcRilAm: QcRilAmService: Wait for IQcRilAudio to be up
- device-sony-common: odm: Add build.prop cleaner, odm: Only leave ro.odm.expect in build.prop
- harware-qcom-display: [LA.UM.8.1.r1] No more COPY_HEADERS, default c++ std, CleanSpec, cleanups
- device-sony-sepolicy: New BSP fixes
- device-sony-sepolicy: radio: Allow finding qti uce service
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:
- @MarijnS95- Marijn Suijten
- @kholk- AngeloGioacchino Del Regno
- @luk1337 - Łukasz Patron
- @oshmoun- Obeida Shamoun
- @ArianK16a
- @Chippa_a
- @AdrianDC
- @arco - Arne Coucheron
- @aviraxp - Wang Han/Hang Wan (LineageOS)
- @bartcubbins - Pavel Dubrova
- @bgcngm - Bruno Martins
- @cryptomilk- Andreas Schneider
- @enesuzun2002 - Enes Uzun
- @ghostrider-reborn - Adithya R
- @humberos - Humberto Borba
- @luca020400 - Luca Stefani
- @stellirin - Adam Farden
- @mikeNG - Michael Bestas (LineageOS)
- @nicknitewolf - Nicholas Lim (LineageOS)
- @DD3Boh - Davide Garberi (LineageOS)
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.