Merge "Remove HideFlaggedApi() related logic and the related product variables" into main

This commit is contained in:
Treehugger Robot 2024-01-17 00:20:54 +00:00 committed by Gerrit Code Review
commit c0412f5d31
5 changed files with 0 additions and 62 deletions

View file

@ -1965,18 +1965,6 @@ func (c *deviceConfig) CheckVendorSeappViolations() bool {
return Bool(c.config.productVariables.CheckVendorSeappViolations)
}
func (c *deviceConfig) NextReleaseHideFlaggedApi() bool {
return Bool(c.config.productVariables.NextReleaseHideFlaggedApi)
}
func (c *deviceConfig) ReleaseExposeFlaggedApi() bool {
return Bool(c.config.productVariables.Release_expose_flagged_api)
}
func (c *deviceConfig) HideFlaggedApis() bool {
return c.NextReleaseHideFlaggedApi() && !c.ReleaseExposeFlaggedApi()
}
func (c *config) GetBuildFlag(name string) (string, bool) {
val, ok := c.productVariables.BuildFlags[name]
return val, ok

View file

@ -491,10 +491,6 @@ type ProductVariables struct {
// partition images. They should not be read from soong modules.
PartitionVarsForBazelMigrationOnlyDoNotUse PartitionVariables `json:",omitempty"`
NextReleaseHideFlaggedApi *bool `json:",omitempty"`
Release_expose_flagged_api *bool `json:",omitempty"`
BuildFlags map[string]string `json:",omitempty"`
BuildFromSourceStub *bool `json:",omitempty"`

View file

@ -55,13 +55,6 @@ var (
}
MetalavaAnnotationsWarningsFlags = strings.Join(metalavaAnnotationsWarningsFlags, " ")
metalavaHideFlaggedApis = []string{
"--revert-annotation",
"android.annotation.FlaggedApi",
}
MetalavaHideFlaggedApis = strings.Join(metalavaHideFlaggedApis, " ")
)
const (
@ -73,8 +66,6 @@ func init() {
exportedVars.ExportString("MetalavaAddOpens", MetalavaAddOpens)
exportedVars.ExportStringList("MetalavaHideFlaggedApis", metalavaHideFlaggedApis)
exportedVars.ExportStringListStaticVariable("MetalavaAnnotationsFlags", metalavaAnnotationsFlags)
exportedVars.ExportStringListStaticVariable("MetalavaAnnotationWarningsFlags", metalavaAnnotationsWarningsFlags)

View file

@ -725,9 +725,6 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
}
cmd.Flag(config.MetalavaFlags)
if ctx.DeviceConfig().HideFlaggedApis() {
cmd.Flag(config.MetalavaHideFlaggedApis)
}
return cmd
}

View file

@ -22,8 +22,6 @@ import (
"testing"
"android/soong/android"
"github.com/google/blueprint/proptools"
)
func TestDroidstubs(t *testing.T) {
@ -364,38 +362,6 @@ func TestGeneratedApiContributionVisibilityTest(t *testing.T) {
ctx.ModuleForTests("bar", "android_common")
}
func TestDroidstubsHideFlaggedApi(t *testing.T) {
result := android.GroupFixturePreparers(
prepareForJavaTest,
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.NextReleaseHideFlaggedApi = proptools.BoolPtr(true)
variables.Release_expose_flagged_api = proptools.BoolPtr(false)
}),
android.FixtureMergeMockFs(map[string][]byte{
"a/A.java": nil,
"a/current.txt": nil,
"a/removed.txt": nil,
}),
).RunTestWithBp(t, `
droidstubs {
name: "foo",
srcs: ["a/A.java"],
api_surface: "public",
check_api: {
current: {
api_file: "a/current.txt",
removed_api_file: "a/removed.txt",
}
},
}
`)
m := result.ModuleForTests("foo", "android_common")
manifest := m.Output("metalava.sbox.textproto")
cmdline := String(android.RuleBuilderSboxProtoForTests(t, result.TestContext, manifest).Commands[0].Command)
android.AssertStringDoesContain(t, "flagged api hide command not included", cmdline, "--revert-annotation android.annotation.FlaggedApi")
}
func TestAconfigDeclarations(t *testing.T) {
result := android.GroupFixturePreparers(
prepareForJavaTest,