Rewrite construct_context.sh in Python.
This allows to reuse SDK version comparison routine from other Python scripts. With the addition of non-numeric versions comparison has become more complex, and the deleted shell script did it incorrectly: it used comparisons like `[[ "S" -lt 28 ]]` which results in "true" as strings are converted to zero in numeric context. This resulted in adding legacy libraries to class loader context of apps targeting recent SDK versions. The error was masked because currently there is only one non-AOSP app that uses the script (GoogleDialer), and it targets numeric SDK version. Test: lunch aosp_cf_x86_phone-userdebug && m Bug: 132357300 Change-Id: I26e752e29b5453fd3e29d5dbfbe4d9df9c0a55b7
This commit is contained in:
@@ -1860,9 +1860,8 @@ func (u *usesLibrary) deps(ctx android.BottomUpMutatorContext, hasFrameworkLibs
|
||||
// creating a cyclic dependency:
|
||||
// e.g. framework-res -> org.apache.http.legacy -> ... -> framework-res.
|
||||
if hasFrameworkLibs {
|
||||
// dexpreopt/dexpreopt.go needs the paths to the dex jars of these libraries in case construct_context.sh needs
|
||||
// to pass them to dex2oat. Add them as a dependency so we can determine the path to the dex jar of each
|
||||
// library to dexpreopt.
|
||||
// Dexpreopt needs paths to the dex jars of these libraries in order to construct
|
||||
// class loader context for dex2oat. Add them as a dependency with a special tag.
|
||||
ctx.AddVariationDependencies(nil, usesLibTag,
|
||||
"org.apache.http.legacy",
|
||||
"android.hidl.base-V1.0-java",
|
||||
|
Reference in New Issue
Block a user