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

Commit 25b16b3d authored by Chiachang Wang's avatar Chiachang Wang Committed by Gerrit Code Review
Browse files

Merge "Set vpn bypassability into VpnTransportInfo"

parents ee4ed803 24177542
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -645,7 +645,8 @@ public class Vpn {
                .addTransportType(NetworkCapabilities.TRANSPORT_VPN)
                .removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)
                .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED)
                .setTransportInfo(new VpnTransportInfo(VpnManager.TYPE_VPN_NONE, null))
                .setTransportInfo(new VpnTransportInfo(
                        VpnManager.TYPE_VPN_NONE, null /* sessionId */, false /* bypassable */))
                .build();

        loadAlwaysOnPackage();
@@ -709,7 +710,8 @@ public class Vpn {
    private void resetNetworkCapabilities() {
        mNetworkCapabilities = new NetworkCapabilities.Builder(mNetworkCapabilities)
                .setUids(null)
                .setTransportInfo(new VpnTransportInfo(VpnManager.TYPE_VPN_NONE, null))
                .setTransportInfo(new VpnTransportInfo(
                        VpnManager.TYPE_VPN_NONE, null /* sessionId */, false /* bypassable */))
                .build();
    }

@@ -1567,7 +1569,8 @@ public class Vpn {
        capsBuilder.setUids(createUserAndRestrictedProfilesRanges(mUserId,
                mConfig.allowedApplications, mConfig.disallowedApplications));

        capsBuilder.setTransportInfo(new VpnTransportInfo(getActiveVpnType(), mConfig.session));
        capsBuilder.setTransportInfo(
                new VpnTransportInfo(getActiveVpnType(), mConfig.session, mConfig.allowBypass));

        // Only apps targeting Q and above can explicitly declare themselves as metered.
        // These VPNs are assumed metered unless they state otherwise.