Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd1e5cd3 authored by Yurii Zubrytskyi's avatar Yurii Zubrytskyi Committed by Automerger Merge Worker
Browse files

Merge changes from topic "Tiramisu-SDK-Finalization-revert-hack" into tm-dev...

Merge changes from topic "Tiramisu-SDK-Finalization-revert-hack" into tm-dev am: 120aa88d am: 4226e4b4 am: aed3061f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18764290



Change-Id: Id43f749910e7d327cd0370071fc77de63af9267c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 699eac59 aed3061f
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -368,9 +368,14 @@ public class FrameworkParsingPackageUtils {
            return input.success(targetVers);
            return input.success(targetVers);
        }
        }


        try {
            if (allowUnknownCodenames && UnboundedSdkLevel.isAtMost(targetCode)) {
            if (allowUnknownCodenames && UnboundedSdkLevel.isAtMost(targetCode)) {
                return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
                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
        // If it's a pre-release SDK and the codename matches this platform, it
        // definitely targets this SDK.
        // definitely targets this SDK.
+22 −6
Original line number Original line Diff line number Diff line
@@ -113,6 +113,24 @@ public class SystemConfig {


    final ArrayList<SplitPermissionInfo> mSplitPermissions = new ArrayList<>();
    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 static final class SharedLibraryEntry {
        public final String name;
        public final String name;
        public final String filename;
        public final String filename;
@@ -180,9 +198,9 @@ public class SystemConfig {
            // - onBootclasspathBefore is set and we are before that SDK
            // - onBootclasspathBefore is set and we are before that SDK
            canBeSafelyIgnored =
            canBeSafelyIgnored =
                    (this.onBootclasspathSince != null
                    (this.onBootclasspathSince != null
                            && UnboundedSdkLevel.isAtLeast(this.onBootclasspathSince))
                            && isAtLeastSdkLevel(this.onBootclasspathSince))
                            || (this.onBootclasspathBefore != null
                            || (this.onBootclasspathBefore != null
                            && !UnboundedSdkLevel.isAtLeast(this.onBootclasspathBefore));
                            && !isAtLeastSdkLevel(this.onBootclasspathBefore));
        }
        }
    }
    }


@@ -885,11 +903,9 @@ public class SystemConfig {
                                        + parser.getPositionDescription());
                                        + parser.getPositionDescription());
                            } else {
                            } else {
                                boolean allowedMinSdk =
                                boolean allowedMinSdk =
                                        minDeviceSdk == null || UnboundedSdkLevel.isAtLeast(
                                        minDeviceSdk == null || isAtLeastSdkLevel(minDeviceSdk);
                                                minDeviceSdk);
                                boolean allowedMaxSdk =
                                boolean allowedMaxSdk =
                                        maxDeviceSdk == null || UnboundedSdkLevel.isAtMost(
                                        maxDeviceSdk == null || isAtMostSdkLevel(maxDeviceSdk);
                                                maxDeviceSdk);
                                final boolean exists = new File(lfile).exists();
                                final boolean exists = new File(lfile).exists();
                                if (allowedMinSdk && allowedMaxSdk && exists) {
                                if (allowedMinSdk && allowedMaxSdk && exists) {
                                    String bcpSince = parser.getAttributeValue(null,
                                    String bcpSince = parser.getAttributeValue(null,