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/runtime/hidden_api.h b/runtime/hidden_api.h
index c4f7cbf..0a40341 100644
--- a/runtime/hidden_api.h
+++ b/runtime/hidden_api.h
@@ -106,8 +106,9 @@
Domain dex_domain = dex_file->GetHiddenapiDomain();
if (class_loader.IsNull() && dex_domain == Domain::kApplication) {
- // LOG(WARNING) << "DexFile " << dex_file->GetLocation() << " is in boot classpath "
- // << "but is assigned untrusted domain";
+ LOG(WARNING) << "DexFile " << dex_file->GetLocation()
+ << " is in boot classpath but is assigned the application domain";
+ dex_file->SetHiddenapiDomain(Domain::kPlatform);
dex_domain = Domain::kPlatform;
}
return dex_domain;