summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Lee <rgl@google.com>2015-07-07 12:33:45 -0700
committerRobin Lee <rgl@google.com>2015-07-07 12:35:14 -0700
commit290784afded5426d5b1d0cb7d71586237445c802 (patch)
tree6f38bda22ff5e6d1f6d2b32797fb4c33411e05e8 /tests
parent66b5a58a6850cbf3a3fdbb8df913f0fc5ea5bdaa (diff)
downloadpackages_apps_Settings-290784afded5426d5b1d0cb7d71586237445c802.zip
packages_apps_Settings-290784afded5426d5b1d0cb7d71586237445c802.tar.gz
packages_apps_Settings-290784afded5426d5b1d0cb7d71586237445c802.tar.bz2
Match getLegacyVpn calls to changed interface
The userId argument is now explicit. Pre-requisite for bug 21499103 Change-Id: Ib83e9615326ea484ef6d63fb1a1d9c1659999dab
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/settings/vpn2/VpnTests.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/src/com/android/settings/vpn2/VpnTests.java b/tests/src/com/android/settings/vpn2/VpnTests.java
index 26cfc9b..11e8265 100644
--- a/tests/src/com/android/settings/vpn2/VpnTests.java
+++ b/tests/src/com/android/settings/vpn2/VpnTests.java
@@ -129,18 +129,20 @@ public class VpnTests extends InstrumentationTestCase {
}
}
// disconnect existing vpn if there is any
- LegacyVpnInfo oldVpn = mService.getLegacyVpnInfo();
+ LegacyVpnInfo oldVpn = mService.getLegacyVpnInfo(UserHandle.myUserId());
if (oldVpn != null) {
Log.v(TAG, "disconnect legacy VPN");
disconnect();
// wait till the legacy VPN is disconnected.
int tries = 0;
- while (tries < MAX_DISCONNECTION_TRIES && mService.getLegacyVpnInfo() != null) {
+ while (tries < MAX_DISCONNECTION_TRIES &&
+ mService.getLegacyVpnInfo(UserHandle.myUserId()) != null) {
tries++;
Thread.sleep(10 * 1000);
Log.v(TAG, "Wait for legacy VPN to be disconnected.");
}
- Assert.assertNull("Failed to disconect VPN", mService.getLegacyVpnInfo());
+ Assert.assertNull("Failed to disconect VPN",
+ mService.getLegacyVpnInfo(UserHandle.myUserId()));
// wait for 30 seconds after the previous VPN is disconnected.
sleep(30 * 1000);
}
@@ -276,7 +278,7 @@ public class VpnTests extends InstrumentationTestCase {
* Verify the vpn connection by checking the VPN state, external IP or ping test
*/
private void validateVpnConnection(VpnProfile profile, boolean pingTestFlag) throws Exception {
- LegacyVpnInfo legacyVpnInfo = mService.getLegacyVpnInfo();
+ LegacyVpnInfo legacyVpnInfo = mService.getLegacyVpnInfo(UserHandle.myUserId());
Assert.assertTrue(legacyVpnInfo != null);
long start = System.currentTimeMillis();
@@ -284,7 +286,7 @@ public class VpnTests extends InstrumentationTestCase {
(legacyVpnInfo.state != LegacyVpnInfo.STATE_CONNECTED)) {
Log.v(TAG, "vpn state: " + legacyVpnInfo.state);
sleep(10 * 1000);
- legacyVpnInfo = mService.getLegacyVpnInfo();
+ legacyVpnInfo = mService.getLegacyVpnInfo(UserHandle.myUserId());
}
// the vpn state should be CONNECTED