Remove HideFlaggedApi() related logic and the related product variables
With the recent build changes to support generating mainlin module sdk with flagged apis, the build no longer depends on the values of these product variables in exposing the flagged apis, but these are determined by the aconfig flags. Given that these variables are no longer used, this change removes these variables and the variables dependent code. Test: m nothing --no-skip-soong-tests Bug: 320515715 Change-Id: I6af94da73cc7fc7ffce670928aad81cec5d383b4
This commit is contained in:
@@ -1961,18 +1961,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
|
||||
|
@@ -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"`
|
||||
|
@@ -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)
|
||||
|
@@ -710,9 +710,6 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
|
||||
}
|
||||
|
||||
cmd.Flag(config.MetalavaFlags)
|
||||
if ctx.DeviceConfig().HideFlaggedApis() {
|
||||
cmd.Flag(config.MetalavaHideFlaggedApis)
|
||||
}
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user