Revert "Add flagged api hide conditional to droidstubs" am: 1180919dda am: 57639c5e65

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2766347

Change-Id: Iba5f7b34be3865e9ac5a72c05a8113e2c0eff55d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Maxim Siniavine 2023-09-28 03:02:11 +00:00 committed by Automerger Merge Worker
commit 4a564b5bcd
3 changed files with 0 additions and 42 deletions

View file

@ -2088,7 +2088,3 @@ func (c *deviceConfig) NextReleaseHideFlaggedApi() bool {
func (c *deviceConfig) ReleaseExposeFlaggedApi() bool {
return Bool(c.config.productVariables.ReleaseExposeFlaggedApi)
}
func (c *deviceConfig) HideFlaggedApis() bool {
return c.NextReleaseHideFlaggedApi() && !c.ReleaseExposeFlaggedApi()
}

View file

@ -540,10 +540,6 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
// See b/285312164 for more information.
cmd.FlagWithArg("--format-defaults ", "overloaded-method-order=source")
if ctx.DeviceConfig().HideFlaggedApis() {
cmd.FlagWithArg("--hide-annotation ", "android.annotation.FlaggedApi")
}
return cmd
}

View file

@ -22,8 +22,6 @@ import (
"testing"
"android/soong/android"
"github.com/google/blueprint/proptools"
)
func TestDroidstubs(t *testing.T) {
@ -405,35 +403,3 @@ 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.ReleaseExposeFlaggedApi = 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, manifest).Commands[0].Command)
android.AssertStringDoesContain(t, "flagged api hide command not included", cmdline, "--hide-annotation android.annotation.FlaggedApi")
}