Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 856cedb2 authored by Anton Hansson's avatar Anton Hansson
Browse files

Add a new flag to stop disabling lint errors

java_sdk_library has historically suppressed a few legitimate lint
errors. Make it possible to remove these suppressions via a flag.

Ignore-AOSP-First: in internal topic, will cp after
Bug: 306806877
Test: checkapi
Change-Id: I10577dacbd7ea8063c6e1e02f3b6c60a2bee5094
parent 5ca568a0
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -618,6 +618,10 @@ type sdkLibraryProperties struct {
	Api_lint struct {
		// Enable api linting.
		Enabled *bool

		// If API lint is enabled, this flag controls whether a set of legitimate lint errors
		// are turned off. The default is true.
		Legacy_errors_allowed *bool
	}

	// TODO: determines whether to create HTML doc or not
@@ -1747,13 +1751,16 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
			android.JoinWithPrefix(module.sdkLibraryProperties.Hidden_api_packages, " --hide-package "))
	}
	droidstubsArgs = append(droidstubsArgs, module.sdkLibraryProperties.Droiddoc_options...)
	disabledWarnings := []string{
	disabledWarnings := []string{"HiddenSuperclass"}
	if proptools.BoolDefault(module.sdkLibraryProperties.Api_lint.Legacy_errors_allowed, true) {
		disabledWarnings = append(disabledWarnings,
			"BroadcastBehavior",
			"DeprecationMismatch",
			"HiddenSuperclass",
			"MissingPermission",
			"SdkConstant",
			"Todo",
		)
	}
	droidstubsArgs = append(droidstubsArgs, android.JoinWithPrefix(disabledWarnings, "--hide "))