Workaround suspended VPNs

This commit is contained in:
M66B
2020-11-28 08:07:31 +01:00
parent 62f9bd1fee
commit c7a219df07

View File

@@ -234,8 +234,11 @@ public class ConnectionHelper {
// onLost [... state: DISCONNECTED/DISCONNECTED ... available: true]
NetworkInfo ani = cm.getNetworkInfo(active);
if (ani == null || ani.getState() != NetworkInfo.State.CONNECTED) {
Log.i("isMetered: no active info ani=" + ani);
return null;
Log.i("isMetered: no/connected active info ani=" + ani);
if (ani == null ||
ani.getState() != NetworkInfo.State.SUSPENDED ||
ani.getType() != ConnectivityManager.TYPE_VPN)
return null;
}
NetworkCapabilities caps = cm.getNetworkCapabilities(active);