Enforce IPsec Tunnel mode for Android Q

This commit adds a second condition to whether the device is expected to
have the tunnel mode feature. If a device's first API/launch version is
Q or above, require IPsec tunnels

Bug: 72950854
Test: Ran on device with first API level < Q and == Q.
Change-Id: I7b849ad24a04b6b7899a80f1856236b5ceb5a839
This commit is contained in:
Benedict Wong
2019-05-10 01:16:10 -07:00
parent 64e64ff454
commit 084c8b47b6

View File

@@ -55,8 +55,10 @@ import android.net.TestNetworkInterface;
import android.net.TestNetworkManager;
import android.net.cts.PacketUtils.Payload;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import android.os.SystemProperties;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
@@ -167,7 +169,9 @@ public class IpSecManagerTunnelTest extends IpSecBaseTest {
}
private static boolean hasTunnelsFeature() {
return sContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS);
return sContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS)
|| SystemProperties.getInt("ro.product.first_api_level", 0)
>= Build.VERSION_CODES.Q;
}
private static void setAppop(int appop, boolean allow) {