Android 10 or higher includes several updatable media components that enable updating framework components through Google Play Store infrastructure or through a partner-provided over-the-air (OTA) mechanism. Media components are packaged together in modules that allows providing security updates and feature updates without requiring a full system image update.
Updatable media components exist in the following modules.
Media Codecs. This module includes updatable software Codec2 components.
For details on adding custom extractors and decoders, see Customizing Media Components.
In Android 9 and lower, extracters are compiled into a single
libstagefright.so file. In Android 10 or higher,
media extractors are separate components. Each extractor has its own
with an entry point that provides a sniffer function to determine whether the
extractor can handle the given media file, and a factory function that creates
an instance of the extractor for the given media file. Each extractor is named
(to help in debugging) and versioned to indicate which extractor is the newest.
The media framework automatically loads all available extractor
.so files, so
you can create your own extractors by adding a new
.so file without needing to
libstagefright or other media framework libraries. You can also ensure
that a custom extractor is preferred over the Google-provided extractor.
The MediaSession2 API allows media apps to expose their transport controls and playback information to other processes such as the Android framework and other apps. This component can't be customized.
The MediaParser API allows ExoPlayer to make efficient use of framework media container parsers to extract media samples from media containers. MediaParser includes the following changes to source code boundaries:
frameworks/base/apex/media/framework/java/android/media/MediaParser.java. API and thin layer implementation.
external/exoplayer/. Exoplayer verbatim sources on which MediaParser is built.
The MediaParser API can’t be customized. To test MediaParser, use the tests in
The Media Codecs module includes updatable software Codec2 components.
Format and dependences
The Media module (
com.android.media) and Media Codec module
com.android.media.swcodec) are in APEX
format. Included media components rely only on NDK APIs.
During an update, the framework components on the device load an APEX package that contains Java and native code.
Figure 1. The media component update flow
After the framework installs the APEX package, the device reboots and mounts the
disk image and media system processes (
the updated modules from the mount point.