My code has a lint error

If lint reports an issue in your code, there are several possible remedies. In descending order of preference:

Fix it

While this isn't always the right response, fixing the lint error or warning should be the default.

Suppress it in code

Android provides an annotation, @SuppressLint, that tells lint to ignore the annotated element. It can be used on classes, constructors, methods, parameters, fields, or local variables, though usage in Chromium is typically limited to the first three.

Like many suppression annotations, @SuppressLint takes a value that tells lint what to ignore. It can be a single String:

Suppress it in the suppressions XML file

lint can be given an XML configuration containing warnings or errors that should be ignored. Chromium's lint suppression XML file can be found in build/android/lint/suppressions.xml. It can be updated to suppress current warnings by running: