tag | 1d391c714331c150a3fd70113f427d288adff384 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Wed Feb 16 01:27:55 2022 -0800 |
object | dc02ae3c5d2f0c1ba3858c9fa2ff345026a509b5 |
Android Mainline 12.0.0 Release 44 (7922654,com.google.android.extservices)
commit | dc02ae3c5d2f0c1ba3858c9fa2ff345026a509b5 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Nov 16 13:39:43 2021 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Nov 16 13:39:43 2021 +0000 |
tree | dff0ae9324c19d6bd4f7ba333a744d691df7073c | |
parent | f97db99f280b7aed8480f0e8e4eb360c48a676e0 [diff] | |
parent | cadae4b458d8ffbd8a9d1538a975b8ab79acd7db [diff] |
Snap for 7920012 from cadae4b458d8ffbd8a9d1538a975b8ab79acd7db to mainline-extservices-release Change-Id: I1cde8d2c66b1aa5b2a53edb9930bdf241db29513
SdkExtensions module is responsible for:
The module is packaged in an apex, com.android.sdkext
, and has several components:
bin/derive_classpath
: a native binary that runs early in the device boot process. It reads individual classpath configs files from the system and other modules, merges them, and defines the definition of *CLASSPATH environ variables.bin/derive_sdk
: native binary that runs early in the device boot process and reads metadata of other modules, to set system properties relating to the extension SDK (for instance build.version.extensions.r
).javalib/framework-sdkextension.jar
: this is a jar on the bootclasspath that exposes APIs to applications to query the extension SDK level.derive_sdk
is a program that reads metadata stored in other apex modules, in the form of binary protobuf files in subpath etc/sdkinfo.pb
inside each apex. The structure of this protobuf can be seen here. The exact steps for converting a set of metadata files to actual extension versions is likely to change over time, and should not be depended upon.
The module exposes a java class SdkExtensions
in the package android.os.ext
. The method getExtensionVersion(int)
can be used to read the version of a particular sdk extension, e.g. getExtensionVersion(Build.VERSION_CODES.R)
.
derive_classpath
service reads and merges individual config files in the /system/etc/classpaths/
and /apex/*/etc/classpaths
. Each config stores protobuf message from classpaths.proto
in a proto binary format. Exact merging algorithm that determines the order of the classpath entries is described in derive_classpath.cpp
and may change over time.
For every new Android SDK level a new extension version should be defined. These are the steps necessary to do that:
derive_sdk.cpp
by:GetSdkLevel
with the new enum setderive_sdk_test.cpp
verifying the new extensions worksSdkExtensions.getExtensionVersion
API support the new extensions.