Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
ModuleMetadata
Stay organized with collections
Save and categorize content based on your preferences.
The ModuleMetadata module contains metadata about the list of modules on a
given device. The metadata is parsed and cached as soon as the system server
starts.
The ModuleMetadata APK contains ModuleInfoProvider
, which
implements the getModuleInfo
and getInstalledModules
methods from the PackageManager's API. These methods are backed
by XML metadata parsed from a module metadata provider package. The package
name for the module metadata package is stored in the
config_defaultModuleMetadataProvider
config value.
The module metadata provider must contain a <metadata>
entry for its <application>
tag. The metadata entry must
contain a single key (android.content.pm.MODULE_METADATA
) whose
value is a reference to an XML resource that contains metadata about the list
of modules on a given device.
The ModuleMetadata module (com.android.modulemetadata
) is delivered
as an APK file.
The XML document must consist of a single top level <module-metadata>
element with one or more children. Each child is a <module>
element that contains the following attributes:
name
is a resource reference to a user-visible package name.
Maps to ModuleInfo#getName
.
packageName
is the package name of the module. Maps to
ModuleInfo#getPackageName
.
isHidden
indicates whether the module is hidden. Maps to
ModuleInfo#isHidden</code>.
Example:
<module-metadata>
<module name="@string/resource" packageName="package_name" isHidden="false|true">
<module .... >
</module-metadata>
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-06-12 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-12 UTC."],[],[],null,["# ModuleMetadata\n\nThe ModuleMetadata module contains metadata about the list of modules on a\ngiven device. The metadata is parsed and cached as soon as the system server\nstarts.\n\nChanges in Android 10\n---------------------\n\nThe ModuleMetadata APK contains `ModuleInfoProvider`, which\nimplements the `getModuleInfo` and `getInstalledModules`\nmethods from the PackageManager's API. These methods are backed\nby XML metadata parsed from a module metadata provider package. The package\nname for the module metadata package is stored in the\n`config_defaultModuleMetadataProvider` config value.\n\nThe module metadata provider must contain a `\u003cmetadata\u003e`\nentry for its `\u003capplication\u003e` tag. The metadata entry must\ncontain a single key (`android.content.pm.MODULE_METADATA`) whose\nvalue is a reference to an XML resource that contains metadata about the list\nof modules on a given device.\n\nPackage format\n--------------\n\nThe ModuleMetadata module (`com.android.modulemetadata`) is delivered\nas an APK file.\n\nMetadata elements\n-----------------\n\nThe XML document must consist of a single top level `\u003cmodule-metadata\u003e`\nelement with one or more children. Each child is a `\u003cmodule\u003e`\nelement that contains the following attributes:\n\n- `name` is a resource reference to a user-visible package name. Maps to `ModuleInfo#getName`.\n- `packageName` is the package name of the module. Maps to `ModuleInfo#getPackageName`.\n- `isHidden` indicates whether the module is hidden. Maps to `ModuleInfo#isHidden\u003c/code\u003e.`\n\nExample: \n\n \u003cmodule-metadata\u003e\n \u003cmodule name=\"@string/resource\" packageName=\"package_name\" isHidden=\"false|true\"\u003e\n \u003cmodule .... \u003e\n \u003c/module-metadata\u003e"]]