V2RayVpnService.kt: use setMetered
setMetered to false let VPN network to inherit its meteredness from its underlying networks. Revert `addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED)`
This commit is contained in:
@@ -76,7 +76,6 @@ class V2RayVpnService : VpnService() {
|
||||
NetworkRequest.Builder()
|
||||
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
|
||||
.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)
|
||||
.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED)
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -198,6 +197,10 @@ class V2RayVpnService : VpnService() {
|
||||
listeningForDefaultNetwork = true
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
builder.setMetered(false)
|
||||
}
|
||||
|
||||
// Create a new interface using the builder and save the parameters.
|
||||
mInterface = builder.establish()
|
||||
sendFd()
|
||||
|
||||
Reference in New Issue
Block a user