Drop ANDROID_ADDITIONAL_PUBLIC_LIBRARIES. am: b94401e6e1 am: c93e2ccc1f am: fbaa652bc8

Original change: https://android-review.googlesource.com/c/platform/art/+/1689793

Change-Id: I97a6b2b42aeaa19857f81f587781a2f2d7ef4f40
diff --git a/libnativeloader/library_namespaces.cpp b/libnativeloader/library_namespaces.cpp
index 59369ee..2360819 100644
--- a/libnativeloader/library_namespaces.cpp
+++ b/libnativeloader/library_namespaces.cpp
@@ -28,7 +28,6 @@
 #include <android-base/file.h>
 #include <android-base/logging.h>
 #include <android-base/macros.h>
-#include <android-base/properties.h>
 #include <android-base/result.h>
 #include <android-base/strings.h>
 #include <nativehelper/scoped_utf_chars.h>
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index 30c7b5a..545d04b 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -49,8 +49,8 @@
 
 // NATIVELOADER_DEFAULT_NAMESPACE_LIBS is an environment variable that can be
 // used when ro.debuggable is true to list extra libraries (separated by ":")
-// that libnativeloader will load from the default namespace. The libraries must
-// be listed without paths, and then LD_LIBRARY_PATH is typically set to the
+// that libnativeloader will load from the default namespace. The libraries
+// must be listed without paths, and then LD_LIBRARY_PATH is typically set to the
 // directories to load them from. The libraries will be available in all
 // classloader namespaces, and also in the fallback namespace used when no
 // classloader is given.
diff --git a/libnativeloader/public_libraries.cpp b/libnativeloader/public_libraries.cpp
index b565133..827be5b 100644
--- a/libnativeloader/public_libraries.cpp
+++ b/libnativeloader/public_libraries.cpp
@@ -28,7 +28,6 @@
 
 #include <android-base/file.h>
 #include <android-base/logging.h>
-#include <android-base/properties.h>
 #include <android-base/result.h>
 #include <android-base/strings.h>
 #include <log/log.h>
@@ -65,11 +64,6 @@
   return android_root_env != nullptr ? android_root_env : "/system";
 }
 
-bool debuggable() {
-  static bool debuggable = android::base::GetBoolProperty("ro.debuggable", false);
-  return debuggable;
-}
-
 std::string vndk_version_str(bool use_product_vndk) {
   if (use_product_vndk) {
     static std::string product_vndk_version = get_vndk_version(true);
@@ -80,16 +74,6 @@
   }
 }
 
-// For debuggable platform builds use ANDROID_ADDITIONAL_PUBLIC_LIBRARIES environment
-// variable to add libraries to the list. This is intended for platform tests only.
-std::string additional_public_libraries() {
-  if (debuggable()) {
-    const char* val = getenv("ANDROID_ADDITIONAL_PUBLIC_LIBRARIES");
-    return val ? val : "";
-  }
-  return "";
-}
-
 // insert vndk version in every {} placeholder
 void InsertVndkVersionStr(std::string* file_name, bool use_product_vndk) {
   CHECK(file_name != nullptr);
@@ -175,12 +159,6 @@
     return "";
   }
 
-  std::string additional_libs = additional_public_libraries();
-  if (!additional_libs.empty()) {
-    auto vec = base::Split(additional_libs, ":");
-    std::copy(vec.begin(), vec.end(), std::back_inserter(*sonames));
-  }
-
   // If this is for preloading libs, don't remove the libs from APEXes.
   if (for_preload) {
     return android::base::Join(*sonames, ':');
@@ -189,11 +167,6 @@
   // Remove the public libs provided by apexes because these libs are available
   // from apex namespaces.
   for (const auto& p : apex_public_libraries()) {
-    // TODO(b/167578583) remove this `if` block after fixing the bug
-    // Skip ART APEX to keep behaviors
-    if (p.first == "com_android_art") {
-      continue;
-    }
     auto public_libs = base::Split(p.second, ":");
     sonames->erase(std::remove_if(sonames->begin(), sonames->end(), [&public_libs](const std::string& v) {
       return std::find(public_libs.begin(), public_libs.end(), v) != public_libs.end();
@@ -472,14 +445,6 @@
     }
     entries[config_line->apex_namespace] = config_line->library_list;
   }
-
-  // TODO(b/167578583) remove this `if` block after fixing the bug
-  if (tag == "public") {
-    std::string additional_libs = additional_public_libraries();
-    if (!additional_libs.empty()) {
-      entries["com_android_art"] += ':' + additional_libs;
-    }
-  }
   return entries;
 }
 
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index ba3c4eb..105af41 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -1172,14 +1172,6 @@
     # which generates `libhiddenapitest_*.so` libraries in `$DEX_LOCATION`).
     LD_LIBRARY_PATH="$DEX_LOCATION:$LD_LIBRARY_PATH"
 
-    # System libraries needed by libarttestd.so
-    PUBLIC_LIBS=libc++.so:libbacktrace.so:libbase.so:libnativehelper.so
-    if [ "$TEST_IS_NDEBUG" = "y" ]; then
-      PUBLIC_LIBS=$PUBLIC_LIBS:libart.so:libdexfile.so:libprofile.so:libartbase.so
-    else
-      PUBLIC_LIBS=$PUBLIC_LIBS:libartd.so:libdexfiled.so:libprofiled.so:libartbased.so
-    fi
-
     # Prepend directories to the path on device.
     PREPEND_TARGET_PATH=$ANDROID_ART_BIN_DIR
     if [ "$ANDROID_ROOT" != "/system" ]; then