Merge changes from topic "Tiramisu-SDK-Finalization-revert-hack" into tm-dev am: 120aa88d0d am: 801d350fff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18764290 Change-Id: Ia19898c436e9b168efebc363ec19e9d3f10084a3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -368,8 +368,13 @@ public class FrameworkParsingPackageUtils {
|
||||
return input.success(targetVers);
|
||||
}
|
||||
|
||||
if (allowUnknownCodenames && UnboundedSdkLevel.isAtMost(targetCode)) {
|
||||
return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
|
||||
try {
|
||||
if (allowUnknownCodenames && UnboundedSdkLevel.isAtMost(targetCode)) {
|
||||
return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
// isAtMost() throws it when encountering an older SDK codename
|
||||
return input.error(PackageManager.INSTALL_FAILED_OLDER_SDK, e.getMessage());
|
||||
}
|
||||
|
||||
// If it's a pre-release SDK and the codename matches this platform, it
|
||||
|
||||
@@ -113,6 +113,24 @@ public class SystemConfig {
|
||||
|
||||
final ArrayList<SplitPermissionInfo> mSplitPermissions = new ArrayList<>();
|
||||
|
||||
private static boolean isAtLeastSdkLevel(String version) {
|
||||
try {
|
||||
return UnboundedSdkLevel.isAtLeast(version);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// UnboundedSdkLevel throws when it sees a known old codename
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isAtMostSdkLevel(String version) {
|
||||
try {
|
||||
return UnboundedSdkLevel.isAtMost(version);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// UnboundedSdkLevel throws when it sees a known old codename
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class SharedLibraryEntry {
|
||||
public final String name;
|
||||
public final String filename;
|
||||
@@ -180,9 +198,9 @@ public class SystemConfig {
|
||||
// - onBootclasspathBefore is set and we are before that SDK
|
||||
canBeSafelyIgnored =
|
||||
(this.onBootclasspathSince != null
|
||||
&& UnboundedSdkLevel.isAtLeast(this.onBootclasspathSince))
|
||||
&& isAtLeastSdkLevel(this.onBootclasspathSince))
|
||||
|| (this.onBootclasspathBefore != null
|
||||
&& !UnboundedSdkLevel.isAtLeast(this.onBootclasspathBefore));
|
||||
&& !isAtLeastSdkLevel(this.onBootclasspathBefore));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -885,11 +903,9 @@ public class SystemConfig {
|
||||
+ parser.getPositionDescription());
|
||||
} else {
|
||||
boolean allowedMinSdk =
|
||||
minDeviceSdk == null || UnboundedSdkLevel.isAtLeast(
|
||||
minDeviceSdk);
|
||||
minDeviceSdk == null || isAtLeastSdkLevel(minDeviceSdk);
|
||||
boolean allowedMaxSdk =
|
||||
maxDeviceSdk == null || UnboundedSdkLevel.isAtMost(
|
||||
maxDeviceSdk);
|
||||
maxDeviceSdk == null || isAtMostSdkLevel(maxDeviceSdk);
|
||||
final boolean exists = new File(lfile).exists();
|
||||
if (allowedMinSdk && allowedMaxSdk && exists) {
|
||||
String bcpSince = parser.getAttributeValue(null,
|
||||
|
||||
Reference in New Issue
Block a user