Integrating Modules
This article describes how to obtain and integrate a Mainline module release package with an Android device build and provides technical guidance on implementing GPSU UX requirements in the Settings application.
Integrating Mainline module release packages
To integrate a module release package into your device build:
-
In your Android implementation repository:
-
Delete all files in the
vendor/partner_modules
. -
Get the module release package using one of the following options:
-
From the shared Drive, extract package contents to the root of your Android implementation repository.
-
From the partner gerrit, using the following command:
repo init -u persistent-https://partner-android.googlesource.com/platform/manifest -b q-aml-prebuilt-release
-
-
Confirm the directory structure contains
vendor/partner_modules
.Example directory structure (tentative)
-
- In the device
product.mk
file, add the following lines:# GPSU modules
PRODUCT_PACKAGES += \
GoogleDocumentsUIPrebuilt \
GoogleExtServicesPrebuilt \
ModuleMetadataGooglePrebuilt \
GooglePermissionControllerPrebuilt
# GPSU module overlay
PRODUCT_PACKAGES += \
GoogleExtServicesConfigOverlay \
GooglePermissionControllerOverlay \
GooglePermissionControllerFrameworkOverlay
-
Determine if the device supports updatable APEX files and configure the appropriate properties:
Device supports updatable
APEXDevices launching with Android 10 must support updatable APEX files, while devices upgrading to Android 10 can support updatable APEX with a properly configured kernel.
To ensure APEX files are updatable, add the following to your
product.mk
file:# Enable updating of APEXes
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)This also adds the
com.android.apex.cts.shim.*.apex
file required for passing CTS when supporting updatable APEX.Device does not support
updatable
APEXDevices upgrading to Android 10 that do not use a properly configured kernel can't support updatable APEX. These devices must use flattened APEX files that are not updatable.
First, set the following property in your
product.mk
file to ensure APEX files aren't updatable:PRODUCT_PROPERTY_OVERRIDES += ro.apex.updatable=false
Then, in
BoardConfig.mk
, add the following property to flatten the APEX files:TARGET_FLATTEN_APEX := true
ALERT: It is invalid to include both flattened and updatable apex files (including
com.android.runtime.[release|debug].apex)
in the/system/apex
or/product/apex
directories. Doing so may cause installation and rollback issues with APEX modules; expect future versions of CTS to verify correct directory contents. -
Determine which modules must be pre-loaded and remove modules that do not need to be pre-loaded.
-
Review the Android 10 GMS Requirements for Google-signed module pre-load requirements. The number of modules that need to be pre-loaded vary depending on the type of device build (upgrades, new launches, or Android Go).
-
For any module that is not required to be pre-loaded, you can (optionally) remove the module
-