From 1a8b713e72960cb7e36aec7ddeabde76d89524f9 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 5 Sep 2023 09:46:17 +0200 Subject: [PATCH] Check restricted/foreground for non VPN only --- .../eu/faircode/email/ConnectionHelper.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ConnectionHelper.java b/app/src/main/java/eu/faircode/email/ConnectionHelper.java index 0e95740e60..d954d69968 100644 --- a/app/src/main/java/eu/faircode/email/ConnectionHelper.java +++ b/app/src/main/java/eu/faircode/email/ConnectionHelper.java @@ -311,17 +311,17 @@ public class ConnectionHelper { Log.i("isMetered: not validated captive=" + captive); return null; } - } - if (!caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)) { - Log.i("isMetered: active restricted"); - return null; - } + if (!caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)) { + Log.i("isMetered: active restricted"); + return null; + } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && - !caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_FOREGROUND)) { - Log.i("isMetered: active background"); - return null; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && + !caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_FOREGROUND)) { + Log.i("isMetered: active background"); + return null; + } } if (vpn_only) {