Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP.
ModuleMetadata
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
ModuleMetadata 模块包含指定设备上模块列表的元数据。系统会在系统服务器启动后立即解析并缓存这类元数据。
ModuleMetadata APK 包含 ModuleInfoProvider,后者用于实现 PackageManager API 中的 getModuleInfo 和 getInstalledModules 方法。这些方法由从模块元数据提供程序软件包解析的 XML 元数据提供支持。模块元数据软件包的软件包名称存储在 config_defaultModuleMetadataProvider 配置值中。
模块元数据提供程序必须包含其 <application> 标记的 <metadata> 条目。元数据条目必须包含单个键 (android.content.pm.MODULE_METADATA),该键的值是对 XML 资源的引用,后者包含指定设备上模块列表的元数据。
ModuleMetadata 模块 (com.android.modulemetadata) 以 APK 文件的形式提供。
XML 文档必须由具有一个或多个子项的单个顶级 <module-metadata> 元素组成。每个子项都是一个 <module> 元素,包含以下属性:
name 是对用户可见的软件包名称的资源引用,映射到 ModuleInfo#getName。
packageName 是模块的软件包名称,映射到 ModuleInfo#getPackageName。
isHidden 表示模块是否已隐藏,映射到 ModuleInfo#isHidden</code>.。
示例:
<module-metadata>
<module name="@string/resource" packageName="package_name" isHidden="false|true">
<module .... >
</module-metadata>
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-10-11。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-10-11。"],[],[]]