Merge "Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT" am: 8608d0626e

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

Change-Id: I13655def2a6e5913031814490106296bc609959f
This commit is contained in:
Remi NGUYEN VAN
2021-07-19 10:08:40 +00:00
committed by Automerger Merge Worker
8 changed files with 9 additions and 9 deletions

View File

@@ -121,7 +121,7 @@ package android.os {
} }
public static class Build.VERSION { public static class Build.VERSION {
field public static final int FIRST_SDK_INT; field public static final int DEVICE_INITIAL_SDK_INT;
} }
public interface Parcelable { public interface Parcelable {

View File

@@ -1037,7 +1037,7 @@ package android.os {
public static class Build.VERSION { public static class Build.VERSION {
field public static final String[] ACTIVE_CODENAMES; field public static final String[] ACTIVE_CODENAMES;
field public static final int FIRST_SDK_INT; field public static final int DEVICE_INITIAL_SDK_INT;
field public static final int RESOURCES_SDK_INT; field public static final int RESOURCES_SDK_INT;
} }

View File

@@ -354,7 +354,7 @@ public final class IpSecAlgorithm implements Parcelable {
} }
for (Entry<String, Integer> entry : ALGO_TO_REQUIRED_FIRST_SDK.entrySet()) { for (Entry<String, Integer> entry : ALGO_TO_REQUIRED_FIRST_SDK.entrySet()) {
if (Build.VERSION.FIRST_SDK_INT >= entry.getValue()) { if (Build.VERSION.DEVICE_INITIAL_SDK_INT >= entry.getValue()) {
enabledAlgos.add(entry.getKey()); enabledAlgos.add(entry.getKey());
} }
} }

View File

@@ -333,7 +333,7 @@ public class Build {
*/ */
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
@TestApi @TestApi
public static final int FIRST_SDK_INT = SystemProperties public static final int DEVICE_INITIAL_SDK_INT = SystemProperties
.getInt("ro.product.first_api_level", 0); .getInt("ro.product.first_api_level", 0);
/** /**

View File

@@ -484,7 +484,7 @@ public class SystemConfig {
// Vendors are only allowed to customize these // Vendors are only allowed to customize these
int vendorPermissionFlag = ALLOW_LIBS | ALLOW_FEATURES | ALLOW_PRIVAPP_PERMISSIONS int vendorPermissionFlag = ALLOW_LIBS | ALLOW_FEATURES | ALLOW_PRIVAPP_PERMISSIONS
| ALLOW_ASSOCIATIONS; | ALLOW_ASSOCIATIONS;
if (Build.VERSION.FIRST_SDK_INT <= Build.VERSION_CODES.O_MR1) { if (Build.VERSION.DEVICE_INITIAL_SDK_INT <= Build.VERSION_CODES.O_MR1) {
// For backward compatibility // For backward compatibility
vendorPermissionFlag |= (ALLOW_PERMISSIONS | ALLOW_APP_CONFIGS); vendorPermissionFlag |= (ALLOW_PERMISSIONS | ALLOW_APP_CONFIGS);
} }
@@ -1252,7 +1252,7 @@ public class SystemConfig {
addFeature(PackageManager.FEATURE_APP_ENUMERATION, 0); addFeature(PackageManager.FEATURE_APP_ENUMERATION, 0);
} }
if (Build.VERSION.FIRST_SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.DEVICE_INITIAL_SDK_INT >= Build.VERSION_CODES.Q) {
addFeature(PackageManager.FEATURE_IPSEC_TUNNELS, 0); addFeature(PackageManager.FEATURE_IPSEC_TUNNELS, 0);
} }

View File

@@ -860,7 +860,7 @@ public class FingerprintService extends BiometricServiceBase {
try { try {
userId = getUserOrWorkProfileId(clientPackage, userId); userId = getUserOrWorkProfileId(clientPackage, userId);
if (userId != mCurrentUserId) { if (userId != mCurrentUserId) {
int firstSdkInt = Build.VERSION.FIRST_SDK_INT; int firstSdkInt = Build.VERSION.DEVICE_INITIAL_SDK_INT;
if (firstSdkInt < Build.VERSION_CODES.BASE) { if (firstSdkInt < Build.VERSION_CODES.BASE) {
Slog.e(TAG, "First SDK version " + firstSdkInt + " is invalid; must be " + Slog.e(TAG, "First SDK version " + firstSdkInt + " is invalid; must be " +
"at least VERSION_CODES.BASE"); "at least VERSION_CODES.BASE");

View File

@@ -596,7 +596,7 @@ public class PackageManagerServiceUtils {
/** Returns true if standard APK Verity is enabled. */ /** Returns true if standard APK Verity is enabled. */
static boolean isApkVerityEnabled() { static boolean isApkVerityEnabled() {
return Build.VERSION.FIRST_SDK_INT >= Build.VERSION_CODES.R return Build.VERSION.DEVICE_INITIAL_SDK_INT >= Build.VERSION_CODES.R
|| SystemProperties.getInt("ro.apk_verity.mode", FSVERITY_DISABLED) || SystemProperties.getInt("ro.apk_verity.mode", FSVERITY_DISABLED)
== FSVERITY_ENABLED; == FSVERITY_ENABLED;
} }

View File

@@ -60,7 +60,7 @@ public class FileIntegrityService extends SystemService {
private final IBinder mService = new IFileIntegrityService.Stub() { private final IBinder mService = new IFileIntegrityService.Stub() {
@Override @Override
public boolean isApkVeritySupported() { public boolean isApkVeritySupported() {
return Build.VERSION.FIRST_SDK_INT >= Build.VERSION_CODES.R return Build.VERSION.DEVICE_INITIAL_SDK_INT >= Build.VERSION_CODES.R
|| SystemProperties.getInt("ro.apk_verity.mode", 0) == 2; || SystemProperties.getInt("ro.apk_verity.mode", 0) == 2;
} }