mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
Added support for standalone VPNs
Like https://github.com/Genymobile/gnirehtet
This commit is contained in:
@@ -265,7 +265,10 @@ public class ConnectionHelper {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean standalone_vpn = prefs.getBoolean("standalone_vpn", false);
|
||||
if (standalone_vpn ||
|
||||
caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) {
|
||||
// NET_CAPABILITY_NOT_METERED is unreliable on older Android versions
|
||||
boolean metered = cm.isActiveNetworkMetered();
|
||||
Log.i("isMetered: active not VPN metered=" + metered);
|
||||
|
||||
Reference in New Issue
Block a user