Loading core/java/android/content/pm/PackageParser.java +0 −18 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java +8 −25 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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. Loading core/java/com/android/server/SystemConfig.java +22 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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)); } } Loading Loading @@ -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, Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -5658,6 +5658,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> Loading core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -4738,6 +4738,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 Loading
core/java/android/content/pm/PackageParser.java +0 −18 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading
core/java/android/content/pm/parsing/FrameworkParsingPackageUtils.java +8 −25 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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. Loading
core/java/com/android/server/SystemConfig.java +22 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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)); } } Loading Loading @@ -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, Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -5658,6 +5658,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> Loading
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -4738,6 +4738,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