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

Commit e282d114 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8712537 from 4c2b5c84 to tm-qpr1-release

Change-Id: Idbc096ff6514439b9d82f7575f079de457b62215
parents d84652cd 4c2b5c84
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -2618,15 +2618,6 @@ public class PackageParser {
            return Build.VERSION_CODES.CUR_DEVELOPMENT;
        }

        // STOPSHIP: hack for the pre-release SDK
        if (platformSdkCodenames.length == 0
                && Build.VERSION.KNOWN_CODENAMES.stream().max(String::compareTo).orElse("").equals(
                targetCode)) {
            Slog.w(TAG, "Package requires development platform " + targetCode
                    + ", returning current version " + Build.VERSION.SDK_INT);
            return Build.VERSION.SDK_INT;
        }

        // Otherwise, we're looking at an incompatible pre-release SDK.
        if (platformSdkCodenames.length > 0) {
            outError[0] = "Requires development platform " + targetCode
@@ -2698,15 +2689,6 @@ public class PackageParser {
            return Build.VERSION_CODES.CUR_DEVELOPMENT;
        }

        // STOPSHIP: hack for the pre-release SDK
        if (platformSdkCodenames.length == 0
                && Build.VERSION.KNOWN_CODENAMES.stream().max(String::compareTo).orElse("").equals(
                minCode)) {
            Slog.w(TAG, "Package requires min development platform " + minCode
                    + ", returning current version " + Build.VERSION.SDK_INT);
            return Build.VERSION.SDK_INT;
        }

        // Otherwise, we're looking at an incompatible pre-release SDK.
        if (platformSdkCodenames.length > 0) {
            outError[0] = "Requires development platform " + minCode
+8 −25
Original line number Diff line number Diff line
@@ -316,15 +316,6 @@ public class FrameworkParsingPackageUtils {
            return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
        }

        // STOPSHIP: hack for the pre-release SDK
        if (platformSdkCodenames.length == 0
                && Build.VERSION.KNOWN_CODENAMES.stream().max(String::compareTo).orElse("").equals(
                        minCode)) {
            Slog.w(TAG, "Parsed package requires min development platform " + minCode
                    + ", returning current version " + Build.VERSION.SDK_INT);
            return input.success(Build.VERSION.SDK_INT);
        }

        // Otherwise, we're looking at an incompatible pre-release SDK.
        if (platformSdkCodenames.length > 0) {
            return input.error(PackageManager.INSTALL_FAILED_OLDER_SDK,
@@ -377,27 +368,19 @@ public class FrameworkParsingPackageUtils {
            return input.success(targetVers);
        }

        // If it's a pre-release SDK and the codename matches this platform, it
        // definitely targets this SDK.
        if (matchTargetCode(platformSdkCodenames, targetCode)) {
            return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
        }

        // STOPSHIP: hack for the pre-release SDK
        if (platformSdkCodenames.length == 0
                && Build.VERSION.KNOWN_CODENAMES.stream().max(String::compareTo).orElse("").equals(
                        targetCode)) {
            Slog.w(TAG, "Parsed package requires development platform " + targetCode
                    + ", returning current version " + Build.VERSION.SDK_INT);
            return input.success(Build.VERSION.SDK_INT);
        }

        try {
            if (allowUnknownCodenames && UnboundedSdkLevel.isAtMost(targetCode)) {
                return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
            }
        } catch (IllegalArgumentException e) {
            return input.error(PackageManager.INSTALL_FAILED_OLDER_SDK, "Bad package SDK");
            // 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
        // definitely targets this SDK.
        if (matchTargetCode(platformSdkCodenames, targetCode)) {
            return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
        }

        // Otherwise, we're looking at an incompatible pre-release SDK.
+22 −6
Original line number Diff line number Diff line
@@ -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,
+3 −0
Original line number Diff line number Diff line
@@ -5692,6 +5692,9 @@
    <!-- Determines whether SafetyCenter feature is enabled. -->
    <bool name="config_enableSafetyCenter">true</bool>

    <!-- Config for whether Safety Protection is enabled. -->
    <bool name="config_safetyProtectionEnabled">false</bool>

    <!-- Flag indicating if help links for Settings app should be enabled. -->
    <bool name="config_settingsHelpLinksEnabled">false</bool>

+2 −0
Original line number Diff line number Diff line
@@ -4751,6 +4751,8 @@

  <java-symbol type="bool" name="config_enableSafetyCenter" />

  <java-symbol type="bool" name="config_safetyProtectionEnabled" />

  <java-symbol type="string" name="config_devicePolicyManagementUpdater" />

  <java-symbol type="string" name="config_deviceSpecificDeviceStatePolicyProvider" />
Loading