Remove unnecessary constraint on previous_api
The constraint requires the previous_api property to be specified
unless validating nullness. However, there is no reason within the
Soong code why that should be.
The only use of previous_api is as the argument to the metalava
--migrate-nullness option which is only added when previous_api is
specified. So, there is no reason in the Soong code for the
constraint.
Metalava also does not require the --migrate-nullness option to be
specified unless validating nullness. So, there is no reason in
metalava for the constraint.
It is therefore safe to remove the constraint.
Bug: 142113521
Test: m checkbuild
Change-Id: I189071e215e928fdf43a39a03d540732743b7a32
diff --git a/java/droiddoc.go b/java/droiddoc.go
index 5d01b54..c898498 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -1325,13 +1325,8 @@
validatingNullability :=
strings.Contains(d.Javadoc.args, "--validate-nullability-from-merged-stubs") ||
String(d.properties.Validate_nullability_from_list) != ""
+
migratingNullability := String(d.properties.Previous_api) != ""
-
- if !(migratingNullability || validatingNullability) {
- ctx.PropertyErrorf("previous_api",
- "has to be non-empty if annotations was enabled (unless validating nullability)")
- }
-
if migratingNullability {
previousApi := android.PathForModuleSrc(ctx, String(d.properties.Previous_api))
cmd.FlagWithInput("--migrate-nullness ", previousApi)