Append platform classpath proto configs with missing apex jars.
Any apex classpath fragment that doesn't generate its own classpaths proto, must still propagate it's boot jars for the platform classpath fragment to include for complete CLASSPATH variables on device. Bug: 191127295 Test: atest CtsClasspathsTestCases derive_classpath_test Change-Id: I93687f69006741fcd66eb6e04891a4b4bbcc3b47
This commit is contained in:
@@ -198,13 +198,29 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo
|
||||
|
||||
// Generate classpaths.proto config
|
||||
func (b *platformBootclasspathModule) generateClasspathProtoBuildActions(ctx android.ModuleContext) {
|
||||
configuredJars := b.configuredJars(ctx)
|
||||
// ART and platform boot jars must have a corresponding entry in DEX2OATBOOTCLASSPATH
|
||||
classpathJars := configuredJarListToClasspathJars(ctx, b.configuredJars(ctx), BOOTCLASSPATH, DEX2OATBOOTCLASSPATH)
|
||||
b.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, classpathJars)
|
||||
classpathJars := configuredJarListToClasspathJars(ctx, configuredJars, BOOTCLASSPATH, DEX2OATBOOTCLASSPATH)
|
||||
b.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars, classpathJars)
|
||||
}
|
||||
|
||||
func (b *platformBootclasspathModule) configuredJars(ctx android.ModuleContext) android.ConfiguredJarList {
|
||||
return b.getImageConfig(ctx).modules
|
||||
// Include all non APEX jars
|
||||
jars := b.getImageConfig(ctx).modules
|
||||
|
||||
// Include jars from APEXes that don't populate their classpath proto config.
|
||||
remainingJars := dexpreopt.GetGlobalConfig(ctx).UpdatableBootJars
|
||||
for _, fragment := range b.fragments {
|
||||
info := ctx.OtherModuleProvider(fragment, ClasspathFragmentProtoContentInfoProvider).(ClasspathFragmentProtoContentInfo)
|
||||
if info.ClasspathFragmentProtoGenerated {
|
||||
remainingJars = remainingJars.RemoveList(info.ClasspathFragmentProtoContents)
|
||||
}
|
||||
}
|
||||
for i := 0; i < remainingJars.Len(); i++ {
|
||||
jars = jars.Append(remainingJars.Apex(i), remainingJars.Jar(i))
|
||||
}
|
||||
|
||||
return jars
|
||||
}
|
||||
|
||||
// checkNonUpdatableModules ensures that the non-updatable modules supplied are not part of an
|
||||
|
Reference in New Issue
Block a user