Fix wrong targetSdkVersion returned by the ApkLiteParseUtils

Tests failed due to wrong targetSdkVersion returned by the apk lite
parser. The result of targetSdkVersion was overwritten by the
ParsingPackageUtils#computeMinSdkVersion.

Bug: 191063347
Test: atest SilentUpdateTests
Change-Id: If24d2c0eac10922903c5ca86d1b8ec8360d92e12
This commit is contained in:
Rhed Jao
2021-06-15 15:44:35 +08:00
parent 2a75262a96
commit 5294b6b745

View File

@@ -493,6 +493,7 @@ public class ApkLiteParseUtils {
if (targetResult.isError()) {
return input.error(targetResult);
}
targetSdkVersion = targetResult.getResult();
ParseResult<Integer> minResult = ParsingPackageUtils.computeMinSdkVersion(
minVer, minCode, ParsingPackageUtils.SDK_VERSION,
@@ -500,8 +501,6 @@ public class ApkLiteParseUtils {
if (minResult.isError()) {
return input.error(minResult);
}
targetSdkVersion = targetResult.getResult();
minSdkVersion = minResult.getResult();
}
}