Stop disabling Metalava quality checks

These checks have been disabled since the initial integration of
metalava in the build system. Stop disabling them, but baseline existing
issues.

For the checks that are disabled for good reason, leave a comment that
explains why.

Bug: 306806877
Test: m checkapi
Change-Id: Ica5c28f798b4aee0ae3722a0bd176bcc621d994e
diff --git a/api/Android.bp b/api/Android.bp
index c4a7895..de4435e 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -315,14 +315,11 @@
         "--error UnhiddenSystemApi",
         "--error UnflaggedApi",
         "--force-convert-to-warning-nullability-annotations +*:-android.*:+android.icu.*:-dalvik.*",
-        "--hide BroadcastBehavior",
+        // Disable CallbackInterface, as Java 8 default interface methods avoid the extensibility
+        // issue interfaces had previously.
         "--hide CallbackInterface",
-        "--hide DeprecationMismatch",
+        // Disable HiddenSuperclass, as Metalava handles this fine (it should be hidden by default)
         "--hide HiddenSuperclass",
-        "--hide MissingPermission",
-        "--hide RequiresPermission",
-        "--hide SdkConstant",
-        "--hide Todo",
         "--hide-package android.audio.policy.configuration.V7_0",
         "--hide-package com.android.server",
         "--manifest $(location :frameworks-base-core-AndroidManifest.xml)",
diff --git a/api/ApiDocs.bp b/api/ApiDocs.bp
index 5744bdf..bcfb68f 100644
--- a/api/ApiDocs.bp
+++ b/api/ApiDocs.bp
@@ -30,6 +30,18 @@
         ":android-test-mock-sources",
         ":android-test-runner-sources",
     ],
+    flags: [
+        // These errors are suppressed in the doc stubs as it isn't easy to suppress them.
+        // They remain unsuppressed/active in the "main" stubs build (the jar stubs).
+        // These can be removed when either a) all the issues have been fixed or
+        // b) these reporting of these issues is gated behind api lint being enabled in metalava.
+        "--hide BroadcastBehavior",
+        "--hide DeprecationMismatch",
+        "--hide MissingPermission",
+        "--hide RequiresPermission",
+        "--hide SdkConstant",
+        "--hide Todo",
+    ],
     create_doc_stubs: true,
     write_sdk_values: true,
 }