Skip to content

Commit

Permalink
Merge "Create LockDownVpnTracker via dependency for testing"
Browse files Browse the repository at this point in the history
  • Loading branch information
Chiachang Wang authored and Gerrit Code Review committed Aug 8, 2022
2 parents 7dae698 + 090e669 commit 00f823f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions services/core/java/com/android/server/VpnManagerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ public Vpn createVpn(Looper looper, Context context, INetworkManagementService n
INetd netd, int userId) {
return new Vpn(looper, context, nms, netd, userId, new VpnProfileStore());
}

/** Create a LockDownVpnTracker. */
public LockdownVpnTracker createLockDownVpnTracker(Context context, Handler handler,
Vpn vpn, VpnProfile profile) {
return new LockdownVpnTracker(context, handler, vpn, profile);
}
}

public VpnManagerService(Context context, Dependencies deps) {
Expand Down Expand Up @@ -502,8 +508,7 @@ public boolean updateLockdownVpn() {
logw("VPN for user " + user + " not ready yet. Skipping lockdown");
return false;
}
setLockdownTracker(
new LockdownVpnTracker(mContext, mHandler, vpn, profile));
setLockdownTracker(mDeps.createLockDownVpnTracker(mContext, mHandler, vpn, profile));
}

return true;
Expand Down

0 comments on commit 00f823f

Please sign in to comment.