Avoid internal APEX stubs in libnative{bridge,loader} and clean up
exported symbols.

The APEX stubs don't have any practical effect on the lazy loading
library wrappers. Add notes about that and update the function wrappers
to keep them in sync.

Also add tests for the lazy libraries. That necessitated some
reshuffling in libnativeloader tests to reuse the mocks.

Test: art/libnativebridge/tests/runtests.sh
Test: atest libnativebridge-lazy-tests
Test: atest libnativeloader_test libnativeloader_lazy_test
Bug: 122710865
Change-Id: I7e291f2e84d8e35731dfb1114c9b19978ff87969
diff --git a/libnativebridge/libnativebridge.map.txt b/libnativebridge/libnativebridge.map.txt
index 158363b..8b51ab8 100644
--- a/libnativebridge/libnativebridge.map.txt
+++ b/libnativebridge/libnativebridge.map.txt
@@ -14,33 +14,18 @@
 # limitations under the License.
 #
 
-# TODO(b/122710865): Most of these uses come from libnativeloader, which should be bundled
-# together with libnativebridge in the APEX. Once this happens, prune this list.
+# Platform dependencies go through libnativebridge_lazy, which accesses
+# libnativebridge symbols through dlopen/dlsym. That means this list doesn't
+# have much effect, rather it's the function wrappers in native_bridge_lazy.cpp
+# that defines the exported interface. Please keep in sync with this list.
 LIBNATIVEBRIDGE_1 {
   global:
-    NativeBridgeIsSupported;
-    NativeBridgeLoadLibrary;
-    NativeBridgeUnloadLibrary;
     NativeBridgeGetError;
-    NativeBridgeIsPathSupported;
-    NativeBridgeCreateNamespace;
-    NativeBridgeGetExportedNamespace;
-    NativeBridgeLinkNamespaces;
-    NativeBridgeLoadLibraryExt;
-    NativeBridgeInitAnonymousNamespace;
     NativeBridgeInitialized;
     NativeBridgeGetTrampoline;
-    LoadNativeBridge;
     PreInitializeNativeBridge;
-    PreZygoteForkNativeBridge;
-    InitializeNativeBridge;
-    NativeBridgeGetVersion;
-    NativeBridgeGetSignalHandler;
-    UnloadNativeBridge;
     NativeBridgeAvailable;
     NeedsNativeBridge;
-    NativeBridgeError;
-    NativeBridgeNameAcceptable;
   local:
     *;
 };