Add compat framework logging to ART
Log first call for every change id in ART to logcat.
Test: manual
Bug: 153061480
Change-Id: I37ff5b88572478ae6c24b0b7dec2020da03b2172
diff --git a/runtime/hidden_api.cc b/runtime/hidden_api.cc
index eb7f7b1..62ff3ff 100644
--- a/runtime/hidden_api.cc
+++ b/runtime/hidden_api.cc
@@ -20,6 +20,7 @@
#include "art_field-inl.h"
#include "art_method-inl.h"
+#include "compat_framework.h"
#include "base/dumpable.h"
#include "base/file_utils.h"
#include "dex/class_accessor-inl.h"
@@ -476,6 +477,7 @@
bool ShouldDenyAccessToMemberImpl(T* member, ApiList api_list, AccessMethod access_method) {
DCHECK(member != nullptr);
Runtime* runtime = Runtime::Current();
+ CompatFramework& compatFramework = runtime->GetCompatFramework();
EnforcementPolicy hiddenApiPolicy = runtime->GetHiddenApiEnforcementPolicy();
DCHECK(hiddenApiPolicy != EnforcementPolicy::kDisabled)
@@ -501,10 +503,10 @@
} else {
switch (api_list.GetMaxAllowedSdkVersion()) {
case SdkVersion::kP:
- deny_access = runtime->isChangeEnabled(kHideMaxtargetsdkPHiddenApis);
+ deny_access = compatFramework.IsChangeEnabled(kHideMaxtargetsdkPHiddenApis);
break;
case SdkVersion::kQ:
- deny_access = runtime->isChangeEnabled(kHideMaxtargetsdkQHiddenApis);
+ deny_access = compatFramework.IsChangeEnabled(kHideMaxtargetsdkQHiddenApis);
break;
default:
deny_access = IsSdkVersionSetAndMoreThan(runtime->GetTargetSdkVersion(),