Implement ModuleInfoProvider
Implements the PackageManager's getModuleInfo and getInstalledModules
API. These APIs are now backed by XML metadata that's 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 meta-data 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 XML document must consist of a single top level <module-metadata>
element with one or more children. Each of these children are <module>
elements. The <module> elements must contain each of the following
attributes :
name : A resource reference to a User visible package name, maps to
ModuleInfo#getName
packageName : The package name of the module, see ModuleInfo#getPackageName
isHidden : Whether the module is hidden, see ModuleInfo#isHidden
Example :
<module-metadata>
<module name="@string/resource" packageName="package_name" isHidden="false|true" />
<module .... />
</module-metadata>
The module metadata is parsed eagerly and cached during system server
startup.
Test: atest FrameworksServicesTests:com.android.server.pm.ModuleInfoProviderTest
Change-Id: I0251c3f7429c42e3cce863eeeea792579dffecfb
Loading
Please register or sign in to comment