Update references to the ART APEX.

Test: Build & boot
Test: atest CtsJniTestCases CtsCompilationTestCases CtsSimpleperfTestCases CtsBionicTestCases
Bug: 135753770
Change-Id: I9635afaf7996407063a0d9ed474b95c0b0e4f890
Merged-In: I9635afaf7996407063a0d9ed474b95c0b0e4f890
diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc
index d74cc14..4f102b8 100644
--- a/libartbase/base/file_utils.cc
+++ b/libartbase/base/file_utils.cc
@@ -71,7 +71,7 @@
 static constexpr const char* kAndroidDataEnvVar = "ANDROID_DATA";
 static constexpr const char* kAndroidDataDefaultPath = "/data";
 static constexpr const char* kAndroidRuntimeRootEnvVar = "ANDROID_RUNTIME_ROOT";
-static constexpr const char* kAndroidRuntimeApexDefaultPath = "/apex/com.android.runtime";
+static constexpr const char* kAndroidArtApexDefaultPath = "/apex/com.android.art";
 static constexpr const char* kAndroidConscryptRootEnvVar = "ANDROID_CONSCRYPT_ROOT";
 static constexpr const char* kAndroidConscryptApexDefaultPath = "/apex/com.android.conscrypt";
 
@@ -80,8 +80,7 @@
 // located:
 // - on host this "root" is normally the Android Root (e.g. something like
 //   "$ANDROID_BUILD_TOP/out/host/linux-x86/");
-// - on target this "root" is normally the Android Runtime Root
-//   ("/apex/com.android.runtime").
+// - on target this "root" is normally the ART Root ("/apex/com.android.art").
 // Return the empty string if that directory cannot be found or if this code is
 // run on Windows or macOS.
 static std::string GetRootContainingLibartbase() {
@@ -125,7 +124,7 @@
   // information to infer the location of the Android Root (on host only).
   //
   // Note that this could change in the future, if we decided to install ART
-  // artifacts in a different location, e.g. within a "Runtime APEX" directory.
+  // artifacts in a different location, e.g. within an "ART APEX" directory.
   if (!kIsTargetBuild) {
     std::string root_containing_libartbase = GetRootContainingLibartbase();
     if (!root_containing_libartbase.empty()) {
@@ -187,7 +186,7 @@
 
 static std::string GetAndroidRuntimeRootSafe(bool must_exist, /*out*/ std::string* error_msg) {
 #ifdef _WIN32
-  UNUSED(kAndroidRuntimeRootEnvVar, kAndroidRuntimeApexDefaultPath, GetRootContainingLibartbase);
+  UNUSED(kAndroidRuntimeRootEnvVar, kAndroidArtApexDefaultPath, GetRootContainingLibartbase);
   UNUSED(must_exist);
   *error_msg = "GetAndroidRuntimeRootSafe unsupported for Windows.";
   return "";
@@ -206,20 +205,20 @@
 
   // On target, libartbase is normally installed in
   // "$ANDROID_RUNTIME_ROOT/lib(64)" (e.g. something like
-  // "/apex/com.android.runtime/lib(64)". Use this information to infer the
-  // location of the Android Runtime Root (on target only).
+  // "/apex/com.android.art/lib(64)". Use this information to infer the
+  // location of the ART Root (on target only).
   if (kIsTargetBuild) {
     // *However*, a copy of libartbase may still be installed outside the
-    // Android Runtime Root on some occasions, as ART target gtests install
-    // their binaries and their dependencies under the Android Root, i.e.
-    // "/system" (see b/129534335). For that reason, we cannot reliably use
-    // `GetRootContainingLibartbase` to find the Android Runtime Root.
-    // (Note that this is not really a problem in practice, as Android Q devices
-    // define ANDROID_RUNTIME_ROOT in their default environment, and will
-    // instead use the logic above anyway.)
+    // ART Root on some occasions, as ART target gtests install their binaries
+    // and their dependencies under the Android Root, i.e. "/system" (see
+    // b/129534335). For that reason, we cannot reliably use
+    // `GetRootContainingLibartbase` to find the ART Root. (Note that this is
+    // not really a problem in practice, as Android Q devices define
+    // ANDROID_RUNTIME_ROOT in their default environment, and will instead use
+    // the logic above anyway.)
     //
     // TODO(b/129534335): Re-enable this logic when the only instance of
-    // libartbase on target is the one from the Runtime APEX.
+    // libartbase on target is the one from the ART APEX.
     if ((false)) {
       std::string root_containing_libartbase = GetRootContainingLibartbase();
       if (!root_containing_libartbase.empty()) {
@@ -229,12 +228,12 @@
   }
 
   // Try the default path.
-  if (must_exist && !OS::DirectoryExists(kAndroidRuntimeApexDefaultPath)) {
-    *error_msg = StringPrintf("Failed to find default Android Runtime Root directory %s",
-                              kAndroidRuntimeApexDefaultPath);
+  if (must_exist && !OS::DirectoryExists(kAndroidArtApexDefaultPath)) {
+    *error_msg = StringPrintf("Failed to find default ART Root directory %s",
+                              kAndroidArtApexDefaultPath);
     return "";
   }
-  return kAndroidRuntimeApexDefaultPath;
+  return kAndroidArtApexDefaultPath;
 #endif
 }
 
@@ -254,11 +253,11 @@
 
 std::string GetAndroidRuntimeBinDir() {
   // Environment variable `ANDROID_RUNTIME_ROOT` is defined as
-  // `$ANDROID_HOST_OUT/com.android.runtime` on host. However, host ART binaries
-  // are still installed in `$ANDROID_HOST_OUT/bin` (i.e. outside the Android
-  // Runtime Root). The situation is cleaner on target, where
-  // `ANDROID_RUNTIME_ROOT` is `$ANDROID_ROOT/apex/com.android.runtime` and ART
-  // binaries are installed in `$ANDROID_ROOT/apex/com.android.runtime/bin`.
+  // `$ANDROID_HOST_OUT/com.android.art` on host. However, host ART binaries are
+  // still installed in `$ANDROID_HOST_OUT/bin` (i.e. outside the ART Root). The
+  // situation is cleaner on target, where `ANDROID_RUNTIME_ROOT` is
+  // `$ANDROID_ROOT/apex/com.android.art` and ART binaries are installed in
+  // `$ANDROID_ROOT/apex/com.android.art/bin`.
   std::string android_runtime_root = kIsTargetBuild ? GetAndroidRuntimeRoot() : GetAndroidRoot();
   return android_runtime_root + "/bin";
 }
@@ -474,7 +473,7 @@
                                                /* must_exist= */ kIsTargetBuild,
                                                &error_msg);
   const char* runtime_root = GetAndroidDirSafe(kAndroidRuntimeRootEnvVar,
-                                               kAndroidRuntimeApexDefaultPath,
+                                               kAndroidArtApexDefaultPath,
                                                /* must_exist= */ kIsTargetBuild,
                                                &error_msg);
   return (android_root != nullptr)