1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-12 04:55:53 +00:00

Fix logic for metered/non-metered wifi run condition

This commit is contained in:
Catfriend1 2018-07-28 02:19:19 +02:00
parent 8dbf9ba953
commit b456249f62

View file

@ -209,9 +209,9 @@ public class RunConditionMonitor {
// Run on wifi.
if (prefRunOnWifi && isWifiOrEthernetConnection()) {
if (prefRunOnMeteredWifi) {
// Check if we are on metered wifi and if wifi whitelist run condition is met.
if (isMeteredNetworkConnection() && wifiWhitelistConditionMet(prefWifiWhitelistEnabled, whitelistedWifiSsids)) {
Log.v(TAG, "decideShouldRun: prefRunOnWifi && isWifiOrEthernetConnection && prefRunOnMeteredWifi && isMeteredNetworkConnection && wifiWhitelistConditionMet");
// We are on non-metered or metered wifi. Check if wifi whitelist run condition is met.
if (wifiWhitelistConditionMet(prefWifiWhitelistEnabled, whitelistedWifiSsids)) {
Log.v(TAG, "decideShouldRun: prefRunOnWifi && isWifiOrEthernetConnection && prefRunOnMeteredWifi && wifiWhitelistConditionMet");
return true;
}
} else {