hiddenapi: Print warnings for @CorePlatformApi violations
When accessing a method/field at runtime, determine the context of both
the caller and the callee, and add new logic for the case
"platform -> core-platform" which used to be always allowed.
If the callee is marked with kAccCorePlatformApi, access is allowed.
If not, a warning is printed into logcat.
Bug: 119068555
Test: 674-hiddenapi
Change-Id: I64839596bf6eb06d7a169fd59b18fd82c140ce6e
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index d537de5..4853187 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -273,6 +273,7 @@
is_low_memory_mode_(false),
safe_mode_(false),
hidden_api_policy_(hiddenapi::EnforcementPolicy::kDisabled),
+ core_platform_api_policy_(hiddenapi::EnforcementPolicy::kJustWarn),
dedupe_hidden_api_warnings_(true),
hidden_api_access_event_log_rate_(0),
dump_native_stack_on_sig_quit_(true),