Revert "InMemoryDexClassLoader in ClassLoaderContext follow-up"

This reverts commit 1a1398ec15accbd905d802e1391c8efbd2d80f98.
Bug: 72131483
Reason for revert: Broke class_loader_context_test on target

Change-Id: Iaa51c8e84536638f39e9ca4c420d1e10ae15e270
diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc
index 8949f5a..165b42d 100644
--- a/runtime/class_loader_context.cc
+++ b/runtime/class_loader_context.cc
@@ -53,7 +53,6 @@
 static constexpr char kClassLoaderSeparator = ';';
 static constexpr char kClasspathSeparator = ':';
 static constexpr char kDexFileChecksumSeparator = '*';
-static constexpr char kInMemoryDexClassLoaderClasspathMagic[] = "<unknown>";
 
 ClassLoaderContext::ClassLoaderContext()
     : special_shared_library_(false),
@@ -170,8 +169,6 @@
       // Checksums are not provided and dex locations themselves have no meaning
       // (although we keep them in the spec to simplify parsing). Treat this as
       // an unknown class loader.
-      // We can hit this case if dex2oat is invoked with a spec containing IMC.
-      // Because the dex file data is only available at runtime, we cannot proceed.
       return nullptr;
     }
   }
@@ -200,7 +197,6 @@
   std::unique_ptr<ClassLoaderInfo> info(new ClassLoaderInfo(class_loader_type));
 
   if (!parse_checksums) {
-    DCHECK(class_loader_type != kInMemoryDexClassLoader);
     Split(classpath, kClasspathSeparator, &info->classpath);
   } else {
     std::vector<std::string> classpath_elements;
@@ -215,10 +211,6 @@
       if (!android::base::ParseUint(dex_file_with_checksum[1].c_str(), &checksum)) {
         return nullptr;
       }
-      if ((class_loader_type == kInMemoryDexClassLoader) &&
-          (dex_file_with_checksum[0] != kInMemoryDexClassLoaderClasspathMagic)) {
-        return nullptr;
-      }
 
       info->classpath.push_back(dex_file_with_checksum[0]);
       info->checksums.push_back(checksum);
@@ -424,8 +416,6 @@
   while (!work_list.empty()) {
     ClassLoaderInfo* info = work_list.back();
     work_list.pop_back();
-    DCHECK(info->type != kInMemoryDexClassLoader) << __FUNCTION__ << " not supported for IMC";
-
     size_t opened_dex_files_index = info->opened_dex_files.size();
     for (const std::string& cp_elem : info->classpath) {
       // If path is relative, append it to the provided base directory.
@@ -634,10 +624,8 @@
     if (k > 0) {
       out << kClasspathSeparator;
     }
-    if (info.type == kInMemoryDexClassLoader) {
-      out << kInMemoryDexClassLoaderClasspathMagic;
-    } else if (!base_dir.empty() && location.substr(0, base_dir.length()) == base_dir) {
-      // Find paths that were relative and convert them back from absolute.
+    // Find paths that were relative and convert them back from absolute.
+    if (!base_dir.empty() && location.substr(0, base_dir.length()) == base_dir) {
       out << location.substr(base_dir.length() + 1).c_str();
     } else {
       out << location.c_str();