Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev am: 36d9c275ac
Change-Id: Ibc0f236234cd87d50a393c3dfaca7898b04e7432
This commit is contained in:
@@ -199,6 +199,8 @@ public class VpnTest {
|
|||||||
when(mContext.getString(R.string.config_customVpnAlwaysOnDisconnectedDialogComponent))
|
when(mContext.getString(R.string.config_customVpnAlwaysOnDisconnectedDialogComponent))
|
||||||
.thenReturn(Resources.getSystem().getString(
|
.thenReturn(Resources.getSystem().getString(
|
||||||
R.string.config_customVpnAlwaysOnDisconnectedDialogComponent));
|
R.string.config_customVpnAlwaysOnDisconnectedDialogComponent));
|
||||||
|
when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS))
|
||||||
|
.thenReturn(true);
|
||||||
when(mSystemServices.isCallerSystem()).thenReturn(true);
|
when(mSystemServices.isCallerSystem()).thenReturn(true);
|
||||||
|
|
||||||
// Used by {@link Notification.Builder}
|
// Used by {@link Notification.Builder}
|
||||||
@@ -730,6 +732,20 @@ public class VpnTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testProvisionVpnProfileNoIpsecTunnels() throws Exception {
|
||||||
|
when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS))
|
||||||
|
.thenReturn(false);
|
||||||
|
final Vpn vpn = createVpnAndSetupUidChecks(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);
|
||||||
|
|
||||||
|
try {
|
||||||
|
checkProvisionVpnProfile(
|
||||||
|
vpn, true /* expectedResult */, AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);
|
||||||
|
fail("Expected exception due to missing feature");
|
||||||
|
} catch (UnsupportedOperationException expected) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProvisionVpnProfilePreconsented() throws Exception {
|
public void testProvisionVpnProfilePreconsented() throws Exception {
|
||||||
final Vpn vpn = createVpnAndSetupUidChecks(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);
|
final Vpn vpn = createVpnAndSetupUidChecks(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);
|
||||||
|
|||||||
Reference in New Issue
Block a user