Merge "Use new VpnTransportInfo constructor" am: 0adb9137a2 am: b6b6f6b1b2

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

Change-Id: If9576d5ceb7614507473537c13cbfa548fbe8dde
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Chiachang Wang
2022-12-14 01:55:40 +00:00
committed by Automerger Merge Worker

View File

@@ -646,7 +646,10 @@ public class Vpn {
.removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN) .removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)
.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED) .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED)
.setTransportInfo(new VpnTransportInfo( .setTransportInfo(new VpnTransportInfo(
VpnManager.TYPE_VPN_NONE, null /* sessionId */, false /* bypassable */)) VpnManager.TYPE_VPN_NONE,
null /* sessionId */,
false /* bypassable */,
false /* longLivedTcpConnectionsExpensive */))
.build(); .build();
loadAlwaysOnPackage(); loadAlwaysOnPackage();
@@ -711,7 +714,10 @@ public class Vpn {
mNetworkCapabilities = new NetworkCapabilities.Builder(mNetworkCapabilities) mNetworkCapabilities = new NetworkCapabilities.Builder(mNetworkCapabilities)
.setUids(null) .setUids(null)
.setTransportInfo(new VpnTransportInfo( .setTransportInfo(new VpnTransportInfo(
VpnManager.TYPE_VPN_NONE, null /* sessionId */, false /* bypassable */)) VpnManager.TYPE_VPN_NONE,
null /* sessionId */,
false /* bypassable */,
false /* longLivedTcpConnectionsExpensive */))
.build(); .build();
} }
@@ -1570,7 +1576,8 @@ public class Vpn {
mConfig.allowedApplications, mConfig.disallowedApplications)); mConfig.allowedApplications, mConfig.disallowedApplications));
capsBuilder.setTransportInfo( capsBuilder.setTransportInfo(
new VpnTransportInfo(getActiveVpnType(), mConfig.session, mConfig.allowBypass)); new VpnTransportInfo(getActiveVpnType(), mConfig.session, mConfig.allowBypass,
false /* longLivedTcpConnectionsExpensive */));
// Only apps targeting Q and above can explicitly declare themselves as metered. // Only apps targeting Q and above can explicitly declare themselves as metered.
// These VPNs are assumed metered unless they state otherwise. // These VPNs are assumed metered unless they state otherwise.