summaryrefslogtreecommitdiff
path: root/libartbase/base/file_utils.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2021-09-07 12:16:56 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2021-09-22 12:23:47 +0000
commitea55f3de90fb3822c41b6f8715ba6adf6cba2bd4 (patch)
tree2c5a92cf99bce02e06c60efa683e816aa9d9d10a /libartbase/base/file_utils.cc
parent52818b0769b697aea537402abb4f7b1d234b6d9e (diff)
Change only_use_system_oat_files_ logic.
If we're creating a process which is a zygote, set it to true. Change it to false on non-system-server fork. This makes sure that zygote doesn't load oat files from /data, which would then make system server abort at startup. Test: 677-fsi, 677-fsi2 Bug: 198531508 Change-Id: I367fcf79f2e60a32457829ddc88b680fc2d00099
Diffstat (limited to 'libartbase/base/file_utils.cc')
-rw-r--r--libartbase/base/file_utils.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc
index c6c1b50a71..884bca15b7 100644
--- a/libartbase/base/file_utils.cc
+++ b/libartbase/base/file_utils.cc
@@ -644,14 +644,12 @@ bool LocationIsOnSystem(const std::string& location) {
LOG(FATAL) << "LocationIsOnSystem is unsupported on Windows.";
return false;
#else
- UniqueCPtr<const char[]> full_path(realpath(location.c_str(), nullptr));
- return full_path != nullptr &&
- android::base::StartsWith(full_path.get(), GetAndroidRoot().c_str());
+ return android::base::StartsWith(location, GetAndroidRoot().c_str());
#endif
}
bool LocationIsTrusted(const std::string& location, bool trust_art_apex_data_files) {
- if (LocationIsOnSystem(location)) {
+ if (LocationIsOnSystem(location) || LocationIsOnArtModule(location)) {
return true;
}
return LocationIsOnArtApexData(location) & trust_art_apex_data_files;