Reorder compatibility libraries used in class loader context.
Compatibility library "android.hidl.manager-V1.0-java" should go
before "android.hidl.base-V1.0-java" in class loader context for
dexpreopt, because this is the order used by PackageManager when it
constructs class loader context on device.
This allows to avoid "ClassLoaderContext classpath element mismatch"
errors on first boot for Calendar and messaging apps, which have old
enough targetSdkVersion to need HIDL compatibility libraries. Previously
the errors were masked because these apps used the deprecated
&-classpath hack.
Bug: 132357300
Test: lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd \
adb wait-for-device && adb root && adb logcat \
| grep -E 'ClassLoaderContext [a-z ]+ mismatch'
# empty grep output, no errors
Change-Id: Ibde9a4578cd86b85a9e7f11d8752716b6567e51e
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 5bfe1a5..560a555 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -143,8 +143,8 @@
org.apache.http.legacy
my_dexpreopt_libs_compat_29 := \
- android.hidl.base-V1.0-java \
- android.hidl.manager-V1.0-java
+ android.hidl.manager-V1.0-java \
+ android.hidl.base-V1.0-java
my_dexpreopt_libs_compat_30 := \
android.test.base \