dex2oat: add --updatable-bcp-packages-file argument.

Add a command line argument specifying a file that contains
the list of updatable boot class path packages.

Test: Updated module_exclusion_test
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: aosp_taimen-userdebug boots.
Bug: 151314205
Change-Id: Ic6a66ad7e565a9b9b344cc467cb1ed550ab41b3f
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 284f19f..daabf01 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -3147,33 +3147,6 @@
   return result_ptr;
 }
 
-static bool IsReservedBootClassPathDescriptor(const char* descriptor) {
-  std::string_view descriptor_sv(descriptor);
-  return
-      // Reserved conscrypt packages (includes sub-packages under these paths).
-      // StartsWith(descriptor_sv, "Landroid/net/ssl/") ||  // Covered by android.net below.
-      StartsWith(descriptor_sv, "Lcom/android/org/conscrypt/") ||
-      // Reserved updatable-media package (includes sub-packages under this path).
-      StartsWith(descriptor_sv, "Landroid/media/") ||
-      // Reserved framework-mediaprovider package (includes sub-packages under this path).
-      StartsWith(descriptor_sv, "Landroid/provider/") ||
-      // Reserved framework-statsd packages (includes sub-packages under these paths).
-      StartsWith(descriptor_sv, "Landroid/app/") ||
-      StartsWith(descriptor_sv, "Landroid/os/") ||
-      StartsWith(descriptor_sv, "Landroid/util/") ||
-      // Reserved framework-permission packages (includes sub-packages under this path).
-      StartsWith(descriptor_sv, "Landroid/permission/") ||
-      // StartsWith(descriptor_sv, "Landroid/app/role/") ||  // Covered by android.app above.
-      // Reserved framework-sdkextensions package (includes sub-packages under this path).
-      // StartsWith(descriptor_sv, "Landroid/os/ext/") ||  // Covered by android.os above.
-      // Reserved framework-wifi packages (includes sub-packages under these paths).
-      StartsWith(descriptor_sv, "Landroid/hardware/wifi/") ||
-      // StartsWith(descriptor_sv, "Landroid/net/wifi/") ||  // Covered by android.net below.
-      StartsWith(descriptor_sv, "Landroid/x/net/wifi/") ||
-      // Reserved framework-tethering package (includes sub-packages under this path).
-      StartsWith(descriptor_sv, "Landroid/net/");
-}
-
 // Helper for maintaining DefineClass counting. We need to notify callbacks when we start/end a
 // define-class and how many recursive DefineClasses we are at in order to allow for doing  things
 // like pausing class definition.
@@ -3251,7 +3224,7 @@
   // with these modules as these classes could be resolved differently during execution.
   if (class_loader != nullptr &&
       Runtime::Current()->IsAotCompiler() &&
-      IsReservedBootClassPathDescriptor(descriptor)) {
+      IsUpdatableBootClassPathDescriptor(descriptor)) {
     ObjPtr<mirror::Throwable> pre_allocated =
         Runtime::Current()->GetPreAllocatedNoClassDefFoundError();
     self->SetException(pre_allocated);
@@ -9861,6 +9834,12 @@
                              ifcount * mirror::IfTable::kMax)));
 }
 
+bool ClassLinker::IsUpdatableBootClassPathDescriptor(const char* descriptor ATTRIBUTE_UNUSED) {
+  // Should not be called on ClassLinker, only on AotClassLinker that overrides this.
+  LOG(FATAL) << "UNREACHABLE";
+  UNREACHABLE();
+}
+
 // Instantiate ClassLinker::ResolveMethod.
 template ArtMethod* ClassLinker::ResolveMethod<ClassLinker::ResolveMode::kCheckICCEAndIAE>(
     uint32_t method_idx,