Assign non-runtime /apex/* dex files to platform domain
Until now only /system/framework and /apex/com.android.runtime were
known locations, assigning "platform" domain to the former and
"core-platform" domain to the latter. The media and conscrypt modules
were left in the "application" domain.
This patch adds a hardcoded path to the apex root and assigns all dex
files in subdirectories to the "platform" domain. This affects both
conscrypt and media modules.
Any other dex files on boot classpath are also assigned to "platform"
on first access. A warning is printed in such case and it is now deduped
to avoid logspam.
Bug: 125701194
Bug: 119068555
Test: compiles, boots, no conscrypt/media warnings about missing domain
Test: art/test.py -b -r -t 674
Change-Id: I33bef18459741095d3d99b541fc88b21cf547800
diff --git a/libartbase/base/file_utils.h b/libartbase/base/file_utils.h
index c8eca59..88dcbea 100644
--- a/libartbase/base/file_utils.h
+++ b/libartbase/base/file_utils.h
@@ -75,7 +75,7 @@
// ReplaceFileExtension("foo", "abc") == "foo.abc"
std::string ReplaceFileExtension(const std::string& filename, const std::string& new_extension);
-// Return whether the location is on apex/com.android.runtime
+// Return whether the location is on /apex/com.android.runtime
bool LocationIsOnRuntimeModule(const char* location);
// Return whether the location is on system (i.e. android root).
@@ -84,6 +84,9 @@
// Return whether the location is on system/framework (i.e. android_root/framework).
bool LocationIsOnSystemFramework(const char* location);
+// Return whether the location is on /apex/.
+bool LocationIsOnApex(const char* location);
+
// dup(2), except setting the O_CLOEXEC flag atomically, when possible.
int DupCloexec(int fd);