summaryrefslogtreecommitdiff
path: root/java/droidstubs.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/droidstubs.go')
-rw-r--r--java/droidstubs.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/java/droidstubs.go b/java/droidstubs.go
index 51503f22a..76c8d8890 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -52,6 +52,19 @@ func (s StubsType) String() string {
}
}
+func StringToStubsType(s string) StubsType {
+ switch strings.ToLower(s) {
+ case Everything.String():
+ return Everything
+ case Runtime.String():
+ return Runtime
+ case Exportable.String():
+ return Exportable
+ default:
+ return Unavailable
+ }
+}
+
func init() {
RegisterStubsBuildComponents(android.InitRegistrationContext)
}
@@ -723,7 +736,7 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
// defined for a module, simply revert all flagged apis annotations. If aconfig_declarations
// property is defined, apply transformations and only revert the flagged apis that are not
// enabled via release configurations and are not specified in aconfig_declarations
-func (d *Droidstubs) generateRevertAnnotationArgs(ctx android.ModuleContext, cmd *android.RuleBuilderCommand, stubsType StubsType, aconfigFlagsPaths android.Paths) {
+func generateRevertAnnotationArgs(ctx android.ModuleContext, cmd *android.RuleBuilderCommand, stubsType StubsType, aconfigFlagsPaths android.Paths) {
if len(aconfigFlagsPaths) == 0 {
cmd.Flag("--revert-annotation android.annotation.FlaggedApi")
@@ -1063,7 +1076,7 @@ func (d *Droidstubs) optionalStubCmd(ctx android.ModuleContext, params stubsComm
cmd := d.commonMetalavaStubCmd(ctx, rule, params)
- d.generateRevertAnnotationArgs(ctx, cmd, params.stubConfig.stubsType, params.stubConfig.deps.aconfigProtoFiles)
+ generateRevertAnnotationArgs(ctx, cmd, params.stubConfig.stubsType, params.stubConfig.deps.aconfigProtoFiles)
if params.stubConfig.doApiLint {
// Pass the lint baseline file as an input to resolve the lint errors.