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
This commit is contained in:
Ulya Trafimovich 2021-03-11 15:10:49 +00:00
parent 928fc2c1ef
commit 413be716ab
1 changed files with 2 additions and 2 deletions

View File

@ -143,8 +143,8 @@ ifeq ($(LOCAL_MODULE_CLASS),APPS)
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 \