Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT
As API review feedback, rename Build#VERSION#FIRST_SDK_INT to Build#VERSION#DEVICE_INITIAL_SDK_INT. As well as update all usage in frameworks and tests. Bug: 184735771 Test: m Change-Id: I72660959cb4e638a8e80fcf2f4e96ea172969f44
This commit is contained in:
@@ -256,7 +256,7 @@ package android.os {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
@@ -1585,7 +1585,7 @@ package android.os {
|
||||
|
||||
public static class Build.VERSION {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ public final class IpSecAlgorithm implements Parcelable {
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ public class Build {
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
@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);
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class VerityUtils {
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
public static boolean isFsVeritySupported() {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ public class SystemConfig {
|
||||
// Vendors are only allowed to customize these
|
||||
int vendorPermissionFlag = ALLOW_LIBS | ALLOW_FEATURES | ALLOW_PRIVAPP_PERMISSIONS
|
||||
| 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
|
||||
vendorPermissionFlag |= (ALLOW_PERMISSIONS | ALLOW_APP_CONFIGS);
|
||||
}
|
||||
@@ -538,9 +538,9 @@ public class SystemConfig {
|
||||
int productPermissionFlag = ALLOW_FEATURES | ALLOW_LIBS | ALLOW_PERMISSIONS
|
||||
| ALLOW_APP_CONFIGS | ALLOW_PRIVAPP_PERMISSIONS | ALLOW_HIDDENAPI_WHITELISTING
|
||||
| ALLOW_ASSOCIATIONS | ALLOW_OVERRIDE_APP_RESTRICTIONS | ALLOW_IMPLICIT_BROADCASTS;
|
||||
if (Build.VERSION.FIRST_SDK_INT <= Build.VERSION_CODES.R) {
|
||||
if (Build.VERSION.DEVICE_INITIAL_SDK_INT <= Build.VERSION_CODES.R) {
|
||||
// TODO(b/157393157): This must check product interface enforcement instead of
|
||||
// FIRST_SDK_VERSION for the devices without product interface enforcement.
|
||||
// DEVICE_INITIAL_SDK_INT for the devices without product interface enforcement.
|
||||
productPermissionFlag = ALLOW_ALL;
|
||||
}
|
||||
readPermissions(Environment.buildPath(
|
||||
@@ -1241,7 +1241,7 @@ public class SystemConfig {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class FingerprintUpdateActiveUserClient extends HalClientMonitor<IBiometr
|
||||
return;
|
||||
}
|
||||
|
||||
int firstSdkInt = Build.VERSION.FIRST_SDK_INT;
|
||||
int firstSdkInt = Build.VERSION.DEVICE_INITIAL_SDK_INT;
|
||||
if (firstSdkInt < Build.VERSION_CODES.BASE) {
|
||||
Slog.e(TAG, "First SDK version " + firstSdkInt + " is invalid; must be " +
|
||||
"at least VERSION_CODES.BASE");
|
||||
|
||||
@@ -133,7 +133,7 @@ public class PermissionMonitor {
|
||||
* Get device first sdk version.
|
||||
*/
|
||||
public int getDeviceFirstSdkInt() {
|
||||
return Build.VERSION.FIRST_SDK_INT;
|
||||
return Build.VERSION.DEVICE_INITIAL_SDK_INT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -602,7 +602,7 @@ public class PackageManagerServiceUtils {
|
||||
|
||||
/** Returns true if standard APK Verity is enabled. */
|
||||
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)
|
||||
== FSVERITY_ENABLED;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class IpSecAlgorithmTest {
|
||||
|
||||
@Test
|
||||
public void testValidationForAlgosAddedInS() throws Exception {
|
||||
if (Build.VERSION.FIRST_SDK_INT <= Build.VERSION_CODES.R) {
|
||||
if (Build.VERSION.DEVICE_INITIAL_SDK_INT <= Build.VERSION_CODES.R) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -194,13 +194,13 @@ public class IpSecAlgorithmTest {
|
||||
private static Set<String> getMandatoryAlgos() {
|
||||
return CollectionUtils.filter(
|
||||
ALGO_TO_REQUIRED_FIRST_SDK.keySet(),
|
||||
i -> Build.VERSION.FIRST_SDK_INT >= ALGO_TO_REQUIRED_FIRST_SDK.get(i));
|
||||
i -> Build.VERSION.DEVICE_INITIAL_SDK_INT >= ALGO_TO_REQUIRED_FIRST_SDK.get(i));
|
||||
}
|
||||
|
||||
private static Set<String> getOptionalAlgos() {
|
||||
return CollectionUtils.filter(
|
||||
ALGO_TO_REQUIRED_FIRST_SDK.keySet(),
|
||||
i -> Build.VERSION.FIRST_SDK_INT < ALGO_TO_REQUIRED_FIRST_SDK.get(i));
|
||||
i -> Build.VERSION.DEVICE_INITIAL_SDK_INT < ALGO_TO_REQUIRED_FIRST_SDK.get(i));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user