Fix library order in class loader context to agree with PackageManager.

PackageManager adds compatibility libraries for different SDK versions
in descending order, and Soong should do the same.

Bug: 132357300

Test: lunch aosp_cf_x86_phone-userdebug && m \
  && launch_cvd \
  && adb wait-for-device \
  && adb logcat | grep -E 'ClassLoaderContext [a-z ]+ mismatch'

  [no messages "ClassLoaderContext classpath element mismatch"]

Change-Id: Ib1d981808ae4022b2c6e73f407a003e8b8e9c7d6
This commit is contained in:
Ulya Trafimovich
2020-12-23 15:41:29 +00:00
parent 0a2afd183a
commit c9f2b9494d
3 changed files with 66 additions and 4 deletions

View File

@@ -2896,8 +2896,8 @@ func TestUsesLibraries(t *testing.T) {
// Test conditional context for target SDK version 29.
if w := `--target-context-for-sdk 29` +
` PCL[/system/framework/android.hidl.base-V1.0-java.jar]` +
`#PCL[/system/framework/android.hidl.manager-V1.0-java.jar] `; !strings.Contains(cmd, w) {
` PCL[/system/framework/android.hidl.manager-V1.0-java.jar]` +
`#PCL[/system/framework/android.hidl.base-V1.0-java.jar] `; !strings.Contains(cmd, w) {
t.Errorf("wanted %q in %q", w, cmd)
}