From cec0d1032c9fcd8cc86baa08938681a1757de0a7 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 18 Dec 2018 17:03:40 +0100 Subject: [PATCH] Evaluate underlying networks only when active network is a VPN --- app/src/main/java/eu/faircode/email/Helper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 89a7c84351..ec36f55c31 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -337,10 +337,10 @@ public class Helper { Log.i(Helper.TAG, "isMetered: active caps=" + caps); - if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN) && - caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED)) { - Log.i(Helper.TAG, "isMetered: active not VPN unmetered"); - return false; + if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) { + boolean unmetered = caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED); + Log.i(Helper.TAG, "isMetered: active not VPN unmetered=" + unmetered); + return !unmetered; } // VPN: evaluate underlying networks