Added visibility needed for the S snapshot

Change https://r.android.com/1762266 moved some modules that depended
upon art.module.public.api from libcore/mmodules/core_platform_api to
build/soong/java/core-libraries. As part of that work
"libcore/mmodules/core_platform_api" was removed from
art.module.public.api's visibility.

Unfortunately, an sdk snapshot generated after that change will not
work in S because it still has the dependency from
libcore/mmodules/core_platform_api to art.module.public.api but the
latter has no matching visibility rule.

This change adds the visibility back along with a message explaining
why it is needed and cannot be removed.

Bug: 239121291
Test: m art-module-sdk
      # Check that it has the missing visibility.
Change-Id: I5bdf3b78d60a1fbcbb4883a726c6d1ae940cd9c5
(cherry picked from commit 8a1867f892d44abad698b52982f60b7fd382882e)
Merged-In: I5bdf3b78d60a1fbcbb4883a726c6d1ae940cd9c5
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index 79521ba..f070571 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -919,6 +919,10 @@
         "//build/soong/java/core-libraries",
         "//frameworks/base",
         "//frameworks/base/api",
+
+        // DO NOT REMOVE: Legacy visibility, needed for snapshots that are
+        // generated for the S build.
+        "//libcore/mmodules/core_platform_api",
     ],
     srcs: [
         ":core_oj_api_files",