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

Commit 2b57c52b authored by junyulai's avatar junyulai
Browse files

Remove reference of getActiveLinkproperties

For callers who access the hidden API, replaced with
public APIs.

Test: atest FrameworksNetTests
Bug: 182963397
Merged-In: Ic0e895c77cf3efb78ddc333c4f3b1016cebcfe17
Change-Id: Ic0e895c77cf3efb78ddc333c4f3b1016cebcfe17
  (cherry-picked from ag/13929756)
parent efbd8b39
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -352,7 +352,10 @@ public class VpnManagerService extends IVpnManager.Stub {
    @Override
    public void startLegacyVpn(VpnProfile profile) {
        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) {
            throw new IllegalStateException("Missing active network connection");
        }