summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/parsed_options.cc1
-rw-r--r--runtime/runtime.cc38
2 files changed, 7 insertions, 32 deletions
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index d574f8e139..ab07ea0f02 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -427,7 +427,6 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize
.WithValueMap(hiddenapi_policy_valuemap)
.IntoKey(M::HiddenApiPolicy)
.Define("-Xcore-platform-api-policy:_")
- .WithHelp("Ignored for SDK level 36+.")
.WithType<hiddenapi::EnforcementPolicy>()
.WithValueMap(hiddenapi_policy_valuemap)
.IntoKey(M::CorePlatformApiPolicy)
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 6f2822fda0..23e06ab792 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1725,37 +1725,13 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) {
hidden_api_policy_ = runtime_options.GetOrDefault(Opt::HiddenApiPolicy);
DCHECK_IMPLIES(is_zygote_, hidden_api_policy_ == hiddenapi::EnforcementPolicy::kDisabled);
- // Set core platform API enforcement policy. Always enabled if the platform
- // SDK level is 36+, otherwise the checks are disabled by default and can be
- // enabled with a command line flag. AndroidRuntime will pass the flag if a
- // system property is set.
- {
- bool always_enable = false;
-#ifdef ART_TARGET_ANDROID
- int device_sdk_version = android_get_device_api_level();
- if (device_sdk_version >= 36) {
- always_enable = true;
- } else if (device_sdk_version == 35) {
- std::string codename =
- android::base::GetProperty("ro.build.version.codename", /*default_value=*/"");
- always_enable = (codename == "Baklava");
- }
-#endif
- const char* reason;
- if (always_enable) {
- core_platform_api_policy_ = hiddenapi::EnforcementPolicy::kEnabled;
- reason = "for Android 16+";
- } else {
- core_platform_api_policy_ = runtime_options.GetOrDefault(Opt::CorePlatformApiPolicy);
- reason = "by runtime option";
- }
- if (core_platform_api_policy_ != hiddenapi::EnforcementPolicy::kDisabled) {
- LOG(INFO) << "Core platform API "
- << (core_platform_api_policy_ == hiddenapi::EnforcementPolicy::kEnabled
- ? "enforcement"
- : "reporting")
- << " enabled " << reason;
- }
+ // Set core platform API enforcement policy. The checks are disabled by default and
+ // can be enabled with a command line flag. AndroidRuntime will pass the flag if
+ // a system property is set.
+ core_platform_api_policy_ = runtime_options.GetOrDefault(Opt::CorePlatformApiPolicy);
+ if (core_platform_api_policy_ != hiddenapi::EnforcementPolicy::kDisabled) {
+ LOG(INFO) << "Core platform API reporting enabled, enforcing="
+ << (core_platform_api_policy_ == hiddenapi::EnforcementPolicy::kEnabled ? "true" : "false");
}
// Dex2Oat's Runtime does not need the signal chain or the fault handler