Revert^2 "Fix the check on apex-versions for boot images."

57b3b54b023e5054f5356c09f929279f50a65b4d

Change-Id: If2469c3a1d2c90409bbfa946d2c72a981b0e68eb
diff --git a/libartbase/base/globals.h b/libartbase/base/globals.h
index 700d4e6..8d37b8a 100644
--- a/libartbase/base/globals.h
+++ b/libartbase/base/globals.h
@@ -71,12 +71,15 @@
 # if defined(ART_TARGET_LINUX)
 static constexpr bool kIsTargetLinux = true;
 static constexpr bool kIsTargetFuchsia = false;
+static constexpr bool kIsTargetAndroid = false;
 # elif defined(ART_TARGET_ANDROID)
 static constexpr bool kIsTargetLinux = false;
 static constexpr bool kIsTargetFuchsia = false;
+static constexpr bool kIsTargetAndroid = true;
 # elif defined(ART_TARGET_FUCHSIA)
 static constexpr bool kIsTargetLinux = false;
 static constexpr bool kIsTargetFuchsia = true;
+static constexpr bool kIsTargetAndroid = false;
 # else
 # error "Either ART_TARGET_LINUX, ART_TARGET_ANDROID or ART_TARGET_FUCHSIA " \
         "needs to be defined for target builds."
@@ -92,6 +95,7 @@
 # else
 static constexpr bool kIsTargetLinux = false;
 static constexpr bool kIsTargetFuchsia = false;
+static constexpr bool kIsTargetAndroid = false;
 # endif
 #endif
 
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index c8ce0b7..633ae7f 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -3484,7 +3484,7 @@
   // The OAT files in the ART APEX is built on host, so they don't have the right APEX versions. It
   // is safe to assume that they are always up-to-date because they are shipped along with the
   // runtime and the dex files.
-  if (kIsTargetBuild && android::base::StartsWith(oat_file.GetLocation(), GetArtRoot())) {
+  if (kIsTargetAndroid && android::base::StartsWith(oat_file.GetLocation(), GetArtRoot())) {
     return true;
   }