Merge changes from topic "sdk_int_cp"
* changes: Fix testSocketKeepaliveLimitTelephony on R Replace FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT in Connectivity
This commit is contained in:
@@ -153,7 +153,7 @@ public class PermissionMonitor {
|
|||||||
* Get device first sdk version.
|
* Get device first sdk version.
|
||||||
*/
|
*/
|
||||||
public int getDeviceFirstSdkInt() {
|
public int getDeviceFirstSdkInt() {
|
||||||
return Build.VERSION.FIRST_SDK_INT;
|
return Build.VERSION.DEVICE_INITIAL_SDK_INT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ import androidx.test.InstrumentationRegistry;
|
|||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
|
import com.android.modules.utils.build.SdkLevel;
|
||||||
import com.android.networkstack.apishim.ConnectivityManagerShimImpl;
|
import com.android.networkstack.apishim.ConnectivityManagerShimImpl;
|
||||||
import com.android.networkstack.apishim.ConstantsShim;
|
import com.android.networkstack.apishim.ConstantsShim;
|
||||||
import com.android.networkstack.apishim.NetworkInformationShimImpl;
|
import com.android.networkstack.apishim.NetworkInformationShimImpl;
|
||||||
@@ -1698,7 +1699,10 @@ public class ConnectivityManagerTest {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int firstSdk = Build.VERSION.FIRST_SDK_INT;
|
final int firstSdk = SdkLevel.isAtLeastS()
|
||||||
|
? Build.VERSION.DEVICE_INITIAL_SDK_INT
|
||||||
|
// FIRST_SDK_INT was a @TestApi field renamed to DEVICE_INITIAL_SDK_INT in S
|
||||||
|
: Build.VERSION.class.getField("FIRST_SDK_INT").getInt(null);
|
||||||
if (firstSdk < Build.VERSION_CODES.Q) {
|
if (firstSdk < Build.VERSION_CODES.Q) {
|
||||||
Log.i(TAG, "testSocketKeepaliveLimitTelephony: skip test for devices launching"
|
Log.i(TAG, "testSocketKeepaliveLimitTelephony: skip test for devices launching"
|
||||||
+ " before Q: " + firstSdk);
|
+ " before Q: " + firstSdk);
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class IpSecAlgorithmTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValidationForAlgosAddedInS() throws Exception {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,13 +196,13 @@ public class IpSecAlgorithmTest {
|
|||||||
private static Set<String> getMandatoryAlgos() {
|
private static Set<String> getMandatoryAlgos() {
|
||||||
return CollectionUtils.filter(
|
return CollectionUtils.filter(
|
||||||
ALGO_TO_REQUIRED_FIRST_SDK.keySet(),
|
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() {
|
private static Set<String> getOptionalAlgos() {
|
||||||
return CollectionUtils.filter(
|
return CollectionUtils.filter(
|
||||||
ALGO_TO_REQUIRED_FIRST_SDK.keySet(),
|
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
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user