Load /data oat/odex files non-executable when only_use_system_oat_files is set.

Make it still ok to use the vdex and the class status in the oat file.
This means:
- If dex code is uncompressed in APK we'll use that
- If dex code is compressed in APK, we'll use the dex code in the vdex.

This is a temporary solution in order to almost mimic performance-wise what
full stack integrity wants to achieve (priv-apps running from verified,
uncompressed dex code in APK).

This is to assess the impact of full stack integrity on privileged apps.

This CL doesn't ensure any integrity, and doesn't check whether the vdex has
been "tainted".

bug: 30972906

Change-Id: If0a6ab26dd6211290db53b7f02d88d45aff68c0c
diff --git a/runtime/base/file_utils.cc b/runtime/base/file_utils.cc
index db49860..c2639a6 100644
--- a/runtime/base/file_utils.cc
+++ b/runtime/base/file_utils.cc
@@ -353,4 +353,9 @@
   return 0;
 }
 
+bool LocationIsOnSystem(const char* location) {
+  UniqueCPtr<const char[]> path(realpath(location, nullptr));
+  return path != nullptr && android::base::StartsWith(path.get(), GetAndroidRoot().c_str());
+}
+
 }  // namespace art