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
diff --git a/libartbase/base/file_utils.h b/libartbase/base/file_utils.h
index 1da19c8..c5e55d1 100644
--- a/libartbase/base/file_utils.h
+++ b/libartbase/base/file_utils.h
@@ -90,6 +90,10 @@
// Return whether the location is on /apex/.
bool LocationIsOnApex(const char* location);
+// Compare the runtime module root against android root. Returns true if they are
+// both known and distinct. This is meant to be a proxy for 'running with apex'.
+bool RuntimeModuleRootDistinctFromAndroidRoot();
+
// dup(2), except setting the O_CLOEXEC flag atomically, when possible.
int DupCloexec(int fd);