Android: Use per-target lint-suppressions.xml

Previously all lint targets shared one lint suppressions/config file:

This resulted in many unnecessary suppressions being added which then
suppress the lint checks for every lint target. e.g. if monochrome fails
ObsoleteSdkInt checks, suppressing it globally turns off the checks for
all other apks, which decreases the utility of android lint for all
those other apks.

This CL removes the shared suppressions.xml file and splits its content
between the targets that actually need them, and adds lint-baseline.xml
files where necessary. This also removes the bottleneck of requiring a
//build/android/OWNERS to stamp every lint suppression change.

This CL also adds suppressions for targets depending on code that chrome
already lints via monochrome. E.g. errors in //base are shared by all
embedders' lint targets, and it should not become the burden of targets
like cast shell or cronet to fix. Thus these errors are suppressed in
cronet/cast/remoting-specific suppressions.xml files.

This CL changes lint to run in the output directory so that baseline
suppressions work for generated files (e.g. AndroidManifest.xml).

Bug: 1113795,1115594
Fixes: 1115594
Change-Id: I2d70128707c0fa862c109b6f91631a07916c90d6
Commit-Queue: Peter Wen <>
Reviewed-by: Yuchen Liu <>
Reviewed-by: Paul Jensen <>
Reviewed-by: Andrew Grieve <>
Reviewed-by: Bo <>
Reviewed-by: Lambros Lambrou <>
Auto-Submit: Peter Wen <>
Cr-Commit-Position: refs/heads/master@{#798776}
GitOrigin-RevId: f74622e693e698c40edd15ca0bc7b75b080f5509
diff --git a/src/org/chromium/support_lib_boundary/util/ b/src/org/chromium/support_lib_boundary/util/
index c2dc613..0be05d2 100644
--- a/src/org/chromium/support_lib_boundary/util/
+++ b/src/org/chromium/support_lib_boundary/util/
@@ -132,6 +132,7 @@
      * @param invocationHandler a {@link Nullable} InvocationHandlerWithDelegateGetter.
      * @return the corresponding delegate.
+    @RequiresApi(Build.VERSION_CODES.KITKAT)
     public static Object getDelegateFromInvocationHandler(
             @Nullable InvocationHandler invocationHandler) {