From bee1c6d9cd956899f910945a1ce123219cc2bde0 Mon Sep 17 00:00:00 2001 From: paulhu Date: Fri, 9 Apr 2021 15:55:09 +0800 Subject: [PATCH] Replace FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT in Connectivity Replace all FIRST_SDK_INT usage in Connectivity because it has been renamed to DEVICE_INITIAL_SDK_INT. Bug: 184735771 Test: m CtsNetTestCases Merged-In: I2f155592b08cdbf259a00b035cacb37ca9847e72 (clean cherry-pick) Change-Id: I2f155592b08cdbf259a00b035cacb37ca9847e72 --- .../com/android/server/connectivity/PermissionMonitor.java | 2 +- .../net/src/android/net/cts/ConnectivityManagerTest.java | 2 +- tests/unit/java/android/net/IpSecAlgorithmTest.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/service/src/com/android/server/connectivity/PermissionMonitor.java b/service/src/com/android/server/connectivity/PermissionMonitor.java index 99118accba..e98a638ce6 100755 --- a/service/src/com/android/server/connectivity/PermissionMonitor.java +++ b/service/src/com/android/server/connectivity/PermissionMonitor.java @@ -145,7 +145,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; } /** diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java index cd5281ff2b..3a15796bc9 100644 --- a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java +++ b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java @@ -1697,7 +1697,7 @@ public class ConnectivityManagerTest { return; } - final int firstSdk = Build.VERSION.FIRST_SDK_INT; + final int firstSdk = Build.VERSION.DEVICE_INITIAL_SDK_INT; if (firstSdk < Build.VERSION_CODES.Q) { Log.i(TAG, "testSocketKeepaliveLimitTelephony: skip test for devices launching" + " before Q: " + firstSdk); diff --git a/tests/unit/java/android/net/IpSecAlgorithmTest.java b/tests/unit/java/android/net/IpSecAlgorithmTest.java index cac8c2d941..c2a759b83a 100644 --- a/tests/unit/java/android/net/IpSecAlgorithmTest.java +++ b/tests/unit/java/android/net/IpSecAlgorithmTest.java @@ -123,7 +123,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; } @@ -196,13 +196,13 @@ public class IpSecAlgorithmTest { private static Set 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 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