libnativeloader: Remove hard-coded cronet am: 735ab4ef26

Change-Id: I28296d8b98d8c1db9f43cc7f51dd7265a6e88872
diff --git a/libnativeloader/library_namespaces.cpp b/libnativeloader/library_namespaces.cpp
index 44b3458..6092c00 100644
--- a/libnativeloader/library_namespaces.cpp
+++ b/libnativeloader/library_namespaces.cpp
@@ -49,7 +49,6 @@
 constexpr const char* kVndkProductNamespaceName = "vndk_product";
 constexpr const char* kArtNamespaceName = "com_android_art";
 constexpr const char* kNeuralNetworksNamespaceName = "com_android_neuralnetworks";
-constexpr const char* kCronetNamespaceName = "com_android_cronet";
 constexpr const char* kStatsdNamespaceName = "com_android_os_statsd";
 
 // classloader-namespace is a linker namespace that is created for the loaded
@@ -316,16 +315,6 @@
     }
   }
 
-  // TODO(b/143733063): Remove it after library path of apex module is supported.
-  auto cronet_ns =
-      NativeLoaderNamespace::GetExportedNamespace(kCronetNamespaceName, is_bridged);
-  if (cronet_ns.ok()) {
-    linked = app_ns->Link(*cronet_ns, cronet_public_libraries());
-    if (!linked.ok()) {
-      return linked.error();
-    }
-  }
-
   // Give access to StatsdAPI libraries
   auto statsd_ns =
       NativeLoaderNamespace::GetExportedNamespace(kStatsdNamespaceName, is_bridged);
diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp
index e36a7e6..3f2505c 100644
--- a/libnativeloader/native_loader_test.cpp
+++ b/libnativeloader/native_loader_test.cpp
@@ -100,7 +100,6 @@
     {"vndk", TO_MOCK_NAMESPACE(TO_ANDROID_NAMESPACE("vndk"))},
     {"vndk_product", TO_MOCK_NAMESPACE(TO_ANDROID_NAMESPACE("vndk_product"))},
     {"com_android_neuralnetworks", TO_MOCK_NAMESPACE(TO_ANDROID_NAMESPACE("com_android_neuralnetworks"))},
-    {"com_android_cronet", TO_MOCK_NAMESPACE(TO_ANDROID_NAMESPACE("com_android_cronet"))},
     {"com_android_os_statsd", TO_MOCK_NAMESPACE(TO_ANDROID_NAMESPACE("com_android_os_statsd"))},
 };
 
@@ -359,7 +358,6 @@
   bool expected_link_with_vndk_product_ns = false;
   bool expected_link_with_default_ns = false;
   bool expected_link_with_neuralnetworks_ns = true;
-  bool expected_link_with_cronet_ns = true;
   bool expected_link_with_statsd_ns = true;
   std::string expected_shared_libs_to_platform_ns = default_public_libraries();
   std::string expected_shared_libs_to_art_ns = art_public_libraries();
@@ -368,7 +366,6 @@
   std::string expected_shared_libs_to_vndk_product_ns = vndksp_libraries_product();
   std::string expected_shared_libs_to_default_ns = default_public_libraries();
   std::string expected_shared_libs_to_neuralnetworks_ns = neuralnetworks_public_libraries();
-  std::string expected_shared_libs_to_cronet_ns = cronet_public_libraries();
   std::string expected_shared_libs_to_statsd_ns = statsd_public_libraries();
 
   void SetExpectations() {
@@ -419,11 +416,6 @@
                                               StrEq(expected_shared_libs_to_neuralnetworks_ns)))
           .WillOnce(Return(true));
     }
-    if (expected_link_with_cronet_ns) {
-      EXPECT_CALL(*mock, mock_link_namespaces(Eq(IsBridged()), _, NsEq("com_android_cronet"),
-                                              StrEq(expected_shared_libs_to_cronet_ns)))
-          .WillOnce(Return(true));
-    }
     if (expected_link_with_statsd_ns) {
       EXPECT_CALL(*mock, mock_link_namespaces(Eq(IsBridged()), _, NsEq("com_android_os_statsd"),
                                               StrEq(expected_shared_libs_to_statsd_ns)))
diff --git a/libnativeloader/public_libraries.cpp b/libnativeloader/public_libraries.cpp
index 4e292ee..b650dc3 100644
--- a/libnativeloader/public_libraries.cpp
+++ b/libnativeloader/public_libraries.cpp
@@ -64,8 +64,6 @@
 constexpr const char* kArtApexLibPath = "/apex/com.android.art/" LIB;
 
 constexpr const char* kNeuralNetworksApexPublicLibrary = "libneuralnetworks.so";
-// STOPSHIP(b/146420818): Figure out how to use stub or non-specific lib name for libcronet.
-constexpr const char* kCronetApexPublicLibrary = "libcronet.80.0.3986.0.so";
 
 constexpr const char* kStatsdApexPublicLibrary = "libstats_jni.so";
 
@@ -308,10 +306,6 @@
   return kNeuralNetworksApexPublicLibrary;
 }
 
-static std::string InitCronetPublicLibraries() {
-  return kCronetApexPublicLibrary;
-}
-
 static std::string InitStatsdPublicLibraries() {
   return kStatsdApexPublicLibrary;
 }
@@ -363,11 +357,6 @@
   return list;
 }
 
-const std::string& cronet_public_libraries() {
-  static std::string list = InitCronetPublicLibraries();
-  return list;
-}
-
 const std::string& statsd_public_libraries() {
   static std::string list = InitStatsdPublicLibraries();
   return list;
diff --git a/libnativeloader/public_libraries.h b/libnativeloader/public_libraries.h
index 1d67d12..9b8b2a4 100644
--- a/libnativeloader/public_libraries.h
+++ b/libnativeloader/public_libraries.h
@@ -33,7 +33,6 @@
 const std::string& preloadable_public_libraries();
 const std::string& default_public_libraries();
 const std::string& art_public_libraries();
-const std::string& cronet_public_libraries();
 const std::string& statsd_public_libraries();
 const std::string& vendor_public_libraries();
 const std::string& extended_public_libraries();