Merge "Remove reference of getActiveLinkproperties" am: 79ddf1afb8 am: fc25cb26f9

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645299

Change-Id: I6ab8cba01e409686202d046dae22658face9d06b
This commit is contained in:
Treehugger Robot
2021-03-22 15:09:39 +00:00
committed by Automerger Merge Worker

View File

@@ -352,7 +352,10 @@ public class VpnManagerService extends IVpnManager.Stub {
@Override @Override
public void startLegacyVpn(VpnProfile profile) { public void startLegacyVpn(VpnProfile profile) {
int user = UserHandle.getUserId(mDeps.getCallingUid()); int user = UserHandle.getUserId(mDeps.getCallingUid());
final LinkProperties egress = mCm.getActiveLinkProperties(); // Note that if the caller is not system (uid >= Process.FIRST_APPLICATION_UID),
// the code might not work well since getActiveNetwork might return null if the uid is
// blocked by NetworkPolicyManagerService.
final LinkProperties egress = mCm.getLinkProperties(mCm.getActiveNetwork());
if (egress == null) { if (egress == null) {
throw new IllegalStateException("Missing active network connection"); throw new IllegalStateException("Missing active network connection");
} }