Merge "Add a test to check if the VPN type is set or not" am: 3b7c0749d5 am: 1ed1f3fcf8

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733785

Change-Id: Iba0daf89608e68b5e17326b9943f438d3f9ae2c6
This commit is contained in:
Lucas Lin
2021-06-16 04:22:38 +00:00
committed by Automerger Merge Worker

View File

@@ -17,6 +17,7 @@
package com.android.cts.net.hostside;
import static android.Manifest.permission.NETWORK_SETTINGS;
import static android.net.ConnectivityManager.TYPE_VPN;
import static android.net.NetworkCapabilities.TRANSPORT_VPN;
import static android.os.Process.INVALID_UID;
import static android.system.OsConstants.AF_INET;
@@ -759,6 +760,7 @@ public class VpnTest extends InstrumentationTestCase {
assertEquals(vpnNetwork, mCM.getActiveNetwork());
assertNotEqual(defaultNetwork, vpnNetwork);
maybeExpectVpnTransportInfo(vpnNetwork);
assertTrue(mCM.getNetworkInfo(vpnNetwork).getType() == TYPE_VPN);
if (SdkLevel.isAtLeastS()) {
// Check that system default network callback has not seen any network changes, even