SoFunction
Updated on 2025-04-18

Android Mainline Basic Introduction

Key Points

  • Android Mainline is a framework for modular updates to Android core components, which may improve security.
  • Allows update of the distribution module via Google Play system without the need for full firmware updates.
  • It can simplify the work of manufacturers and reduce fragmentation, but has limited coverage.

What is Android Mainline?

Android Mainline is a framework introduced by Google in Android 9 (Pie) and above. By modularizing key components of the Android system, it allows these components to be distributed and updated in the form of standalone modules (called Mainline modules or APEX/ART modules) through Google Play System Updates without the need for a full system firmware update (OTA).

  • Introduce time: Android 9 (2019) was first introduced, Android 10 (2019) was officially expanded, and Android 12 (2021) and further improved.

Its core goals include:

  • Quick update: Enable core system components (such as security patches, system services) to be quickly pushed, bypassing the long firmware update process of device manufacturers.
  • consistency: Ensure that Android devices from different manufacturers run the same version of core components, reducing the fragmentation problem of the Android ecosystem.
  • Security: Fix security vulnerabilities and protect user data by timely updating key components.
  • Simplify the work of the manufacturer: Reduce the workload of device manufacturers to adapt to new Android versions and reduce the development burden.

How Android Mainline works

The core of Android Mainline is to mirror system components from traditional Android system () is stripped and packaged as an independent updateable module. These modules can be updated through the Google Play Store or similar mechanisms, with the main mechanisms including the following aspects:

(1) Mainline module type

Mainline modules are divided into two categories:

type describe Storage location Example usage
APEX module Updateable containers that encapsulate native code, Java code, configuration files, etc. /apexPartition, mounted as a separate file system during runtime Media codec, Wi-Fi stack
APK module Modules distributed in traditional APK form, usually containing Java code /systemor/dataPartition Permission Controller

APEX (Android Pony EXpress) module

  • It is a secure modular container that supports dynamic loading and updates, and is usually used for core components that require underlying permissions, such as media codecs, Wi-Fi stacks.
  • Stored in/apexPartition, mounted as a read-only file system at runtime, ensuring system stability and security.

APK module

  • Modules distributed in the form of traditional APKs, usually contain Java code, and are suitable for components that do not require underlying permissions, such as permission controllers.
  • Stored in/systemor/dataPartition, update method is similar to that of ordinary applications.

(2) Google Play System Update

  • The Mainline module is distributed through Google Play System Updates, similar to app updates.
  • Users can view and install these updates in device settings (usually in Settings > Security > Google Play System Updates).

Updates are pushed directly by Google without the intervention of device manufacturers, simplifying the update process. Updates may require a device restart to apply (for example, reduce interrupts through the A/B partitioning mechanism), ensuring a seamless experience.

(3) Modular components

As of Android 15 (2025), here are some common Mainline modules, some of which vary by version and device:

category Module Example Function description
Core system services Permission Controller Manage application permissions
System UI (System UI) Some interface elements
Module Metadata Manage metadata for other modules
Media and Connections Media Codecs Audio/Video Decoding
Wi-Fi stack Wi-Fi connection management
Bluetooth Stack Bluetooth protocol and features
Safety related Conscrypt Encryption library
DNS Resolver Domain name analysis
Runtime and framework ART(Android Runtime) Optimize application performance
Runtime module Core Java Library
other Neural Networks API(NNAPI) Machine Learning Support
Captive Portal Login Public Wi-Fi login page

The versions of these modules are decoupled from the Android version, allowing new modules to be run on older Android versions, enhancing backward compatibility.
Details of each module on the official website/docs/core/ota/modular-system?hl=zh-cn

This is all about this article about the introduction of Android Mainline. For more information about Android Mainline, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!