Merge "Use modular removed-dex.txt files for greylisting." am: b7f5c22ee4
Change-Id: I8f0e10b32bec4102c0bb565379c27d1a6630e9eb
This commit is contained in:
@@ -211,23 +211,30 @@ func stubFlagsRule(ctx android.SingletonContext) {
|
|||||||
// the greylists.
|
// the greylists.
|
||||||
func flagsRule(ctx android.SingletonContext) android.Path {
|
func flagsRule(ctx android.SingletonContext) android.Path {
|
||||||
var flagsCSV android.Paths
|
var flagsCSV android.Paths
|
||||||
|
var greylistRemovedApis android.Paths
|
||||||
var greylistIgnoreConflicts android.Path
|
|
||||||
|
|
||||||
ctx.VisitAllModules(func(module android.Module) {
|
ctx.VisitAllModules(func(module android.Module) {
|
||||||
if h, ok := module.(hiddenAPIIntf); ok {
|
if h, ok := module.(hiddenAPIIntf); ok {
|
||||||
if csv := h.flagsCSV(); csv != nil {
|
if csv := h.flagsCSV(); csv != nil {
|
||||||
flagsCSV = append(flagsCSV, csv)
|
flagsCSV = append(flagsCSV, csv)
|
||||||
}
|
}
|
||||||
} else if ds, ok := module.(*Droidstubs); ok && ctx.ModuleName(module) == "hiddenapi-lists-docs" {
|
} else if ds, ok := module.(*Droidstubs); ok {
|
||||||
greylistIgnoreConflicts = ds.removedDexApiFile
|
// Track @removed public and system APIs via corresponding droidstubs targets.
|
||||||
|
// These APIs are not present in the stubs, however, we have to keep allowing access
|
||||||
|
// to them at runtime.
|
||||||
|
if m := ctx.ModuleName(module); m == "api-stubs-docs" || m == "system-api-stubs-docs" {
|
||||||
|
greylistRemovedApis = append(greylistRemovedApis, ds.removedDexApiFile)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if greylistIgnoreConflicts == nil {
|
combinedRemovedApis := android.PathForOutput(ctx, "hiddenapi", "combined-removed-dex.txt")
|
||||||
ctx.Errorf("failed to find removed_dex_api_filename from hiddenapi-lists-docs module")
|
ctx.Build(pctx, android.BuildParams{
|
||||||
return nil
|
Rule: android.Cat,
|
||||||
}
|
Inputs: greylistRemovedApis,
|
||||||
|
Output: combinedRemovedApis,
|
||||||
|
Description: "Combine removed apis for " + combinedRemovedApis.String(),
|
||||||
|
})
|
||||||
|
|
||||||
rule := android.NewRuleBuilder()
|
rule := android.NewRuleBuilder()
|
||||||
|
|
||||||
@@ -242,8 +249,7 @@ func flagsRule(ctx android.SingletonContext) android.Path {
|
|||||||
Inputs(flagsCSV).
|
Inputs(flagsCSV).
|
||||||
FlagWithInput("--greylist ",
|
FlagWithInput("--greylist ",
|
||||||
android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist.txt")).
|
android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist.txt")).
|
||||||
FlagWithInput("--greylist-ignore-conflicts ",
|
FlagWithInput("--greylist-ignore-conflicts ", combinedRemovedApis).
|
||||||
greylistIgnoreConflicts).
|
|
||||||
FlagWithInput("--greylist-max-q ",
|
FlagWithInput("--greylist-max-q ",
|
||||||
android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist-max-q.txt")).
|
android.PathForSource(ctx, "frameworks/base/config/hiddenapi-greylist-max-q.txt")).
|
||||||
FlagWithInput("--greylist-max-p ",
|
FlagWithInput("--greylist-max-p ",
|
||||||
|
Reference in New Issue
Block a user