mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-04 22:40:32 +00:00
Workaround invalid not metered indication
This commit is contained in:
parent
417ca4cb2a
commit
b9e5a52f20
1 changed files with 4 additions and 3 deletions
|
@ -197,9 +197,10 @@ public class ConnectionHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) {
|
if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) {
|
||||||
boolean unmetered = caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
|
// NET_CAPABILITY_NOT_METERED is unreliable on older Android versions
|
||||||
Log.i("isMetered: active not VPN unmetered=" + unmetered);
|
boolean metered = cm.isActiveNetworkMetered();
|
||||||
return !unmetered;
|
Log.i("isMetered: active not VPN metered=" + metered);
|
||||||
|
return metered;
|
||||||
}
|
}
|
||||||
|
|
||||||
// VPN: evaluate underlying networks
|
// VPN: evaluate underlying networks
|
||||||
|
|
Loading…
Reference in a new issue