diff options
author | 2020-04-30 18:53:43 +0100 | |
---|---|---|
committer | 2020-05-05 08:52:20 +0000 | |
commit | 50f89ba3237da01adfdbc65abc330d1c8d5af07e (patch) | |
tree | 98e9d52845a6b7114529628144cd9c51b56904c2 | |
parent | 8419b82fa8d46362eb1369ec1876ee2d3c4bc29d (diff) |
Calling @IntraCoreApi from core-icu4j should not cause "Core platform API violation"
Treat I18n APEX as the same domain as ART and Conscrypt APEX.
Remove unused varaiable isJavaDebuggable because it causes the
NoSuchMethodError for an unknown reason:
java.lang.NoSuchMethodError: No virtual method isJavaDebuggable()Z in class Ldalvik/system/VMRuntime; or its super classes (declaration of 'dalvik.system.VMRuntime' appears in /apex/com.android.art/javalib/core-libart.jar)
Bug: 138994281
Test: art/test/run-test --chroot $ART_TEST_CHROOT 674-hiddenapi
Change-Id: Icb7e98b5cd7143c06c05dd4377af0c96ba75bca7
-rw-r--r-- | libartbase/base/file_utils.cc | 6 | ||||
-rw-r--r-- | libartbase/base/file_utils.h | 3 | ||||
-rw-r--r-- | runtime/hidden_api.cc | 3 | ||||
-rw-r--r-- | test/674-hiddenapi/src-ex/ChildClass.java | 1 |
4 files changed, 11 insertions, 2 deletions
diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc index 98b69f3df5..e82796458c 100644 --- a/libartbase/base/file_utils.cc +++ b/libartbase/base/file_utils.cc @@ -72,6 +72,7 @@ static constexpr const char* kAndroidDataEnvVar = "ANDROID_DATA"; static constexpr const char* kAndroidDataDefaultPath = "/data"; static constexpr const char* kAndroidArtRootEnvVar = "ANDROID_ART_ROOT"; static constexpr const char* kAndroidConscryptRootEnvVar = "ANDROID_CONSCRYPT_ROOT"; +static constexpr const char* kAndroidI18nRootEnvVar = "ANDROID_I18N_ROOT"; // Get the "root" directory containing the "lib" directory where this instance // of the libartbase library (which contains `GetRootContainingLibartbase`) is @@ -453,6 +454,11 @@ bool LocationIsOnConscryptModule(const char* full_path) { full_path, kAndroidConscryptRootEnvVar, kAndroidConscryptApexDefaultPath); } +bool LocationIsOnI18nModule(const char* full_path) { + return IsLocationOnModule( + full_path, kAndroidI18nRootEnvVar, kAndroidI18nApexDefaultPath); +} + bool LocationIsOnApex(const char* full_path) { return android::base::StartsWith(full_path, kApexDefaultPath); } diff --git a/libartbase/base/file_utils.h b/libartbase/base/file_utils.h index a521c97c58..de60483c69 100644 --- a/libartbase/base/file_utils.h +++ b/libartbase/base/file_utils.h @@ -104,6 +104,9 @@ bool LocationIsOnArtModule(const char* location); // Return whether the location is on /apex/com.android.conscrypt bool LocationIsOnConscryptModule(const char* location); +// Return whether the location is on /apex/com.android.i18n +bool LocationIsOnI18nModule(const char* location); + // Return whether the location is on system (i.e. android root). bool LocationIsOnSystem(const char* location); diff --git a/runtime/hidden_api.cc b/runtime/hidden_api.cc index 6ac57b61f7..d13d716555 100644 --- a/runtime/hidden_api.cc +++ b/runtime/hidden_api.cc @@ -94,7 +94,8 @@ static Domain DetermineDomainFromLocation(const std::string& dex_location, // is set to "/system". if (ArtModuleRootDistinctFromAndroidRoot()) { if (LocationIsOnArtModule(dex_location.c_str()) || - LocationIsOnConscryptModule(dex_location.c_str())) { + LocationIsOnConscryptModule(dex_location.c_str()) || + LocationIsOnI18nModule(dex_location.c_str())) { return Domain::kCorePlatform; } diff --git a/test/674-hiddenapi/src-ex/ChildClass.java b/test/674-hiddenapi/src-ex/ChildClass.java index 9295655f44..855134bc08 100644 --- a/test/674-hiddenapi/src-ex/ChildClass.java +++ b/test/674-hiddenapi/src-ex/ChildClass.java @@ -103,7 +103,6 @@ public class ChildClass { ChildClass.everythingWhitelisted = everythingWhitelisted; boolean isSameBoot = (isParentInBoot == isChildInBoot); - boolean isDebuggable = VMRuntime.getRuntime().isJavaDebuggable(); // For compat reasons, meta-reflection should still be usable by apps if hidden api check // hardening is disabled (i.e. target SDK is Q or earlier). The only configuration where this |