Mock Vpn.setLockdown()
Call setRequireVpnForUids directly to enable lockdown instead of calling the real Vpn method. Bug: 230548427 Test: atest FrameworksNetTests Change-Id: I91ec59f7542d145e9250a7e7a414593db3d99424
This commit is contained in:
@@ -10206,7 +10206,8 @@ public class ConnectivityServiceTest {
|
|||||||
// Init lockdown state to simulate LockdownVpnTracker behavior.
|
// Init lockdown state to simulate LockdownVpnTracker behavior.
|
||||||
mCm.setLegacyLockdownVpnEnabled(true);
|
mCm.setLegacyLockdownVpnEnabled(true);
|
||||||
mMockVpn.setEnableTeardown(false);
|
mMockVpn.setEnableTeardown(false);
|
||||||
mMockVpn.setLockdown(true);
|
final Set<Range<Integer>> ranges = UidRange.toIntRanges(Set.of(PRIMARY_UIDRANGE));
|
||||||
|
mCm.setRequireVpnForUids(true /* requireVpn */, ranges);
|
||||||
|
|
||||||
// Bring up a network.
|
// Bring up a network.
|
||||||
final LinkProperties cellLp = new LinkProperties();
|
final LinkProperties cellLp = new LinkProperties();
|
||||||
|
|||||||
Reference in New Issue
Block a user