use of com.android.internal.net.VpnProfile in project android_packages_apps_Settings by omnirom.
the class ConfigDialogFragment method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Bundle args = getArguments();
VpnProfile profile = (VpnProfile) args.getParcelable(ARG_PROFILE);
boolean editing = args.getBoolean(ARG_EDITING);
boolean exists = args.getBoolean(ARG_EXISTS);
final Dialog dialog = new ConfigDialog(getActivity(), this, profile, editing, exists);
dialog.setOnShowListener(this);
return dialog;
}
use of com.android.internal.net.VpnProfile in project android_packages_apps_Settings by omnirom.
the class VpnTests method testL2tpIpsecRsaConnection.
/**
* Test L2TP/IPSec RSA VPN connection
*/
@LargeTest
public void testL2tpIpsecRsaConnection() throws Exception {
mPreviousIpAddress = getIpAddress();
VpnInfo curVpnInfo = mVpnInfoPool.get(VpnProfile.TYPE_L2TP_IPSEC_RSA);
VpnProfile vpnProfile = curVpnInfo.getVpnProfile();
if (DEBUG) {
printVpnProfile(vpnProfile);
}
String certFile = curVpnInfo.getCertificateFile();
String password = curVpnInfo.getPassword();
installCertificatesFromFile(vpnProfile, certFile, password);
connect(vpnProfile);
validateVpnConnection(vpnProfile);
}
use of com.android.internal.net.VpnProfile in project android_packages_apps_Settings by omnirom.
the class VpnTests method testPPTPConnection.
/**
* Test PPTP VPN connection
*/
@LargeTest
public void testPPTPConnection() throws Exception {
mPreviousIpAddress = getIpAddress();
VpnInfo curVpnInfo = mVpnInfoPool.get(VpnProfile.TYPE_PPTP);
VpnProfile vpnProfile = curVpnInfo.getVpnProfile();
connect(vpnProfile);
validateVpnConnection(vpnProfile);
}
use of com.android.internal.net.VpnProfile in project android_packages_apps_Settings by omnirom.
the class VpnTests method testL2tpIpsecPskConnection.
/**
* Test L2TP/IPSec PSK VPN connection
*/
@LargeTest
public void testL2tpIpsecPskConnection() throws Exception {
mPreviousIpAddress = getIpAddress();
VpnInfo curVpnInfo = mVpnInfoPool.get(VpnProfile.TYPE_L2TP_IPSEC_PSK);
VpnProfile vpnProfile = curVpnInfo.getVpnProfile();
connect(vpnProfile);
validateVpnConnection(vpnProfile);
}
use of com.android.internal.net.VpnProfile in project android_packages_apps_Settings by crdroidandroid.
the class PreferenceListTest method testDisconnectedLegacyVpnShown.
@SmallTest
public void testDisconnectedLegacyVpnShown() {
final VpnProfile vpnProfile = new VpnProfile("test-disconnected");
final VpnSettings.UpdatePreferences updater = new VpnSettings.UpdatePreferences(mSettings);
updater.legacyVpns(/* vpnProfiles */
Collections.<VpnProfile>singletonList(vpnProfile), /* connectedLegacyVpns */
Collections.<String, LegacyVpnInfo>emptyMap(), /* lockdownVpnKey */
null);
updater.run();
verify(mSettings, times(1)).findOrCreatePreference(any(VpnProfile.class), eq(true));
assertEquals(1, mLegacyMocks.size());
assertEquals(0, mAppMocks.size());
}
Aggregations