Merge changes Ibaf383c4,I2b1c0736 am: 139fa4320f
Change-Id: I71377d3a6e5395732aee75e3e129d3684b523c13
This commit is contained in:
@@ -170,9 +170,21 @@ func hiddenAPIEncodeDex(ctx android.ModuleContext, output android.WritablePath,
|
|||||||
tmpOutput = android.PathForModuleOut(ctx, "hiddenapi", "unaligned", "unaligned.jar")
|
tmpOutput = android.PathForModuleOut(ctx, "hiddenapi", "unaligned", "unaligned.jar")
|
||||||
tmpDir = android.PathForModuleOut(ctx, "hiddenapi", "unaligned")
|
tmpDir = android.PathForModuleOut(ctx, "hiddenapi", "unaligned")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enforceHiddenApiFlagsToAllMembers := true
|
||||||
// If frameworks/base doesn't exist we must be building with the 'master-art' manifest.
|
// If frameworks/base doesn't exist we must be building with the 'master-art' manifest.
|
||||||
// Disable assertion that all methods/fields have hidden API flags assigned.
|
// Disable assertion that all methods/fields have hidden API flags assigned.
|
||||||
if !ctx.Config().FrameworksBaseDirExists(ctx) {
|
if !ctx.Config().FrameworksBaseDirExists(ctx) {
|
||||||
|
enforceHiddenApiFlagsToAllMembers = false
|
||||||
|
}
|
||||||
|
// b/149353192: when a module is instrumented, jacoco adds synthetic members
|
||||||
|
// $jacocoData and $jacocoInit. Since they don't exist when building the hidden API flags,
|
||||||
|
// don't complain when we don't find hidden API flags for the synthetic members.
|
||||||
|
if j, ok := ctx.Module().(*Library); ok && j.shouldInstrument(ctx) {
|
||||||
|
enforceHiddenApiFlagsToAllMembers = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if !enforceHiddenApiFlagsToAllMembers {
|
||||||
hiddenapiFlags = "--no-force-assign-all"
|
hiddenapiFlags = "--no-force-assign-all"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1519,6 +1519,14 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
|||||||
j.headerJarFile = j.implementationJarFile
|
j.headerJarFile = j.implementationJarFile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force enable the instrumentation for java code that is built for APEXes ...
|
||||||
|
// except for the jacocoagent itself (because instrumenting jacocoagent using jacocoagent
|
||||||
|
// doesn't make sense)
|
||||||
|
isJacocoAgent := ctx.ModuleName() == "jacocoagent"
|
||||||
|
if android.DirectlyInAnyApex(ctx, ctx.ModuleName()) && !isJacocoAgent && !j.IsForPlatform() {
|
||||||
|
j.properties.Instrument = true
|
||||||
|
}
|
||||||
|
|
||||||
if j.shouldInstrument(ctx) {
|
if j.shouldInstrument(ctx) {
|
||||||
outputFile = j.instrument(ctx, flags, outputFile, jarName)
|
outputFile = j.instrument(ctx, flags, outputFile, jarName)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user