Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 001e831d authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Remove temporary hack in VpnTest.

This temporary hack was necessary due to b/175883995. Now that
that bug is fixed, remove the hack.

Bug: 171529940
Test: test-only change
Change-Id: I48bd594cf3a37575f4888c1be9a1cf535de2e4d2
parent 97d09a26
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -953,14 +953,7 @@ public class VpnTest {
    }

    private Vpn startLegacyVpn(final Vpn vpn, final VpnProfile vpnProfile) throws Exception {
        // TODO(b/175883995): once these tests have been updated for the changes to the UserManager
        // API, remove this ad-hoc setup code and use setMockedUsers(primaryUser) again.
        // setMockedUsers(primaryUser);
        final ArrayList<UserInfo> users = new ArrayList<>();
        users.add(primaryUser);
        when(mUserManager.getAliveUsers()).thenReturn(users);
        when(mUserManager.getUserInfo(primaryUser.id)).thenReturn(primaryUser);
        when(mUserManager.canHaveRestrictedProfile()).thenReturn(false);
        setMockedUsers(primaryUser);

        // Dummy egress interface
        final LinkProperties lp = new LinkProperties();
@@ -1159,10 +1152,6 @@ public class VpnTest {
        doReturn(UserHandle.of(userId)).when(asUserContext).getUser();
        when(mContext.createContextAsUser(eq(UserHandle.of(userId)), anyInt()))
                .thenReturn(asUserContext);
        when(asUserContext.getSystemServiceName(UserManager.class))
                .thenReturn(Context.USER_SERVICE);
        when(asUserContext.getSystemService(UserManager.class))
                .thenReturn(mUserManager);
        final TestLooper testLooper = new TestLooper();
        final Vpn vpn = new Vpn(testLooper.getLooper(), mContext, new TestDeps(), mNetService,
                mNetd, userId, mKeyStore, mSystemServices, mIkev2SessionCreator);