summaryrefslogtreecommitdiff
path: root/libartbase/base/file_utils.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2019-03-15 11:35:51 +0000
committer David Brazdil <dbrazdil@google.com> 2019-03-16 07:34:43 +0000
commitbfaba288427e80e7941e49c4264ba8f6cd6d97d1 (patch)
treedb8e893b87c2406275c82599d43e9b9a5b0f895c /libartbase/base/file_utils.cc
parent7dd0f0f2b4af0b15389ca8624bde93e1fb7ed776 (diff)
Fix buildbots hidden_api_test
Target buildbots set /system to be the runtime module root because they are running without an apex. The test assumes that /system dex files are assigned to the application domain but here they get assigned to the core-platform domain. Adjust the domain setting logic to check if the runtime module root is distict from the android root (as a proxy for 'is running with apex'). If not (as is the case with the buildbots), skip checks against apex locations. Test: m test-art-target-gtest-hidden_api_test Change-Id: Iff3890ec69cb04a1e4ed5bc2a3b5c652ada05f36
Diffstat (limited to 'libartbase/base/file_utils.cc')
-rw-r--r--libartbase/base/file_utils.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc
index 1f8457a484..865c8a6a85 100644
--- a/libartbase/base/file_utils.cc
+++ b/libartbase/base/file_utils.cc
@@ -334,6 +334,16 @@ bool LocationIsOnSystemFramework(const char* full_path) {
return android::base::StartsWith(full_path, framework_path);
}
+bool RuntimeModuleRootDistinctFromAndroidRoot() {
+ std::string error_msg;
+ std::string android_root = GetAndroidRootSafe(&error_msg);
+ const char* runtime_root =
+ GetAndroidDirSafe(kRuntimeApexEnvVar, kRuntimeApexDefaultPath, &error_msg);
+ return !android_root.empty()
+ && (runtime_root != nullptr)
+ && (android_root != std::string_view(runtime_root));
+}
+
int DupCloexec(int fd) {
#if defined(__linux__)
return fcntl(fd, F_DUPFD_CLOEXEC, 0);