diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java
index 49d3fab5..cf34c232 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java
@@ -270,6 +270,12 @@ public class MainActivity extends StateDialogActivity
startActivity(new Intent(this, FirstStartActivity.class));
this.finish();
}
+
+ // Evaluate run conditions to detect changes made to the metered wifi flags.
+ SyncthingService mSyncthingService = getService();
+ if (mSyncthingService != null) {
+ mSyncthingService.evaluateRunConditions();
+ }
super.onResume();
}
diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/SettingsActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/SettingsActivity.java
index 1fa12d9a..47c7bf9f 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/activities/SettingsActivity.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/SettingsActivity.java
@@ -17,7 +17,9 @@ import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
+import android.text.TextUtils;
import android.util.Log;
+import android.widget.ListAdapter;
import android.widget.Toast;
import com.google.common.base.Joiner;
@@ -38,6 +40,8 @@ import com.nutomic.syncthingandroid.views.WifiSsidPreference;
import java.lang.ref.WeakReference;
import java.security.InvalidParameterException;
+import java.util.HashSet;
+import java.util.Set;
import javax.inject.Inject;
@@ -45,11 +49,18 @@ import eu.chainfire.libsuperuser.Shell;
public class SettingsActivity extends SyncthingActivity {
+ public static final String EXTRA_OPEN_SUB_PREF_SCREEN =
+ "com.nutomic.syncthingandroid.activities.SettingsActivity.OPEN_SUB_PREF_SCREEN";
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ SettingsFragment settingsFragment = new SettingsFragment();
+ Bundle bundle = new Bundle();
+ bundle.putString(EXTRA_OPEN_SUB_PREF_SCREEN, getIntent().getStringExtra(EXTRA_OPEN_SUB_PREF_SCREEN));
+ settingsFragment.setArguments(bundle);
getFragmentManager().beginTransaction()
- .replace(android.R.id.content, new SettingsFragment())
+ .replace(android.R.id.content, settingsFragment)
.commit();
}
@@ -90,9 +101,12 @@ public class SettingsActivity extends SyncthingActivity {
private Preference mCategoryRunConditions;
private CheckBoxPreference mAlwaysRunInBackground;
- private CheckBoxPreference mSyncOnlyCharging;
- private CheckBoxPreference mSyncOnlyWifi;
- private WifiSsidPreference mSyncOnlyOnSSIDs;
+ private ListPreference mPowerSource;
+ private CheckBoxPreference mRunOnMobileData;
+ private CheckBoxPreference mRunOnWifi;
+ private CheckBoxPreference mRunOnMeteredWifi;
+ private WifiSsidPreference mWifiSsidWhitelist;
+ private CheckBoxPreference mRunInFlightMode;
private Preference mCategorySyncthingOptions;
private EditTextPreference mDeviceName;
@@ -154,16 +168,18 @@ public class SettingsActivity extends SyncthingActivity {
PreferenceScreen screen = getPreferenceScreen();
mAlwaysRunInBackground =
(CheckBoxPreference) findPreference(Constants.PREF_ALWAYS_RUN_IN_BACKGROUND);
- mSyncOnlyCharging =
- (CheckBoxPreference) findPreference(Constants.PREF_SYNC_ONLY_CHARGING);
- mSyncOnlyWifi =
- (CheckBoxPreference) findPreference(Constants.PREF_SYNC_ONLY_WIFI);
- mSyncOnlyOnSSIDs =
- (WifiSsidPreference) findPreference(Constants.PREF_SYNC_ONLY_WIFI_SSIDS);
-
- mSyncOnlyCharging.setEnabled(mAlwaysRunInBackground.isChecked());
- mSyncOnlyWifi.setEnabled(mAlwaysRunInBackground.isChecked());
- mSyncOnlyOnSSIDs.setEnabled(mSyncOnlyWifi.isChecked());
+ mPowerSource =
+ (ListPreference) findPreference(Constants.PREF_POWER_SOURCE);
+ mRunOnMobileData =
+ (CheckBoxPreference) findPreference(Constants.PREF_RUN_ON_WIFI);
+ mRunOnWifi =
+ (CheckBoxPreference) findPreference(Constants.PREF_RUN_ON_WIFI);
+ mRunOnMeteredWifi =
+ (CheckBoxPreference) findPreference(Constants.PREF_RUN_ON_METERED_WIFI);
+ mWifiSsidWhitelist =
+ (WifiSsidPreference) findPreference(Constants.PREF_WIFI_SSID_WHITELIST);
+ mRunInFlightMode =
+ (CheckBoxPreference) findPreference(Constants.PREF_RUN_IN_FLIGHT_MODE);
ListPreference languagePref = (ListPreference) findPreference(Languages.PREFERENCE_LANGUAGE);
PreferenceScreen categoryBehaviour = (PreferenceScreen) findPreference("category_behaviour");
@@ -216,7 +232,8 @@ public class SettingsActivity extends SyncthingActivity {
mSyncthingVersion = findPreference("syncthing_version");
Preference appVersion = screen.findPreference("app_version");
- mSyncOnlyOnSSIDs.setEnabled(mSyncOnlyWifi.isChecked());
+ mRunOnMeteredWifi.setEnabled(mRunOnWifi.isChecked());
+ mWifiSsidWhitelist.setEnabled(mRunOnWifi.isChecked());
mCategorySyncthingOptions = findPreference("category_syncthing_options");
setPreferenceCategoryChangeListener(mCategorySyncthingOptions, this::onSyncthingPreferenceChange);
@@ -244,6 +261,12 @@ public class SettingsActivity extends SyncthingActivity {
/* Initialize summaries */
mPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
+ screen.findPreference(Constants.PREF_POWER_SOURCE).setSummary(mPowerSource.getEntry());
+ String wifiSsidSummary = TextUtils.join(", ", mPreferences.getStringSet(Constants.PREF_WIFI_SSID_WHITELIST, new HashSet<>()));
+ screen.findPreference(Constants.PREF_WIFI_SSID_WHITELIST).setSummary(TextUtils.isEmpty(wifiSsidSummary) ?
+ getString(R.string.run_on_all_wifi_networks) :
+ getString(R.string.run_on_whitelisted_wifi_networks, wifiSsidSummary)
+ );
handleSocksProxyPreferenceChange(screen.findPreference(Constants.PREF_SOCKS_PROXY_ADDRESS), mPreferences.getString(Constants.PREF_SOCKS_PROXY_ADDRESS, ""));
handleHttpProxyPreferenceChange(screen.findPreference(Constants.PREF_HTTP_PROXY_ADDRESS), mPreferences.getString(Constants.PREF_HTTP_PROXY_ADDRESS, ""));
@@ -253,6 +276,30 @@ public class SettingsActivity extends SyncthingActivity {
} catch (PackageManager.NameNotFoundException e) {
Log.d(TAG, "Failed to get app version name");
}
+
+ openSubPrefScreen(screen);
+ }
+
+ private void openSubPrefScreen(PreferenceScreen prefScreen) {
+ Bundle bundle = getArguments();
+ if (bundle == null) {
+ return;
+ }
+ String openSubPrefScreen = bundle.getString(EXTRA_OPEN_SUB_PREF_SCREEN, "");
+ // Open sub preferences screen if EXTRA_OPEN_SUB_PREF_SCREEN was passed in bundle.
+ if (openSubPrefScreen != null && !TextUtils.isEmpty(openSubPrefScreen)) {
+ Log.v(TAG, "Transitioning to pref screen " + openSubPrefScreen);
+ PreferenceScreen categoryRunConditions = (PreferenceScreen) findPreference(openSubPrefScreen);
+ final ListAdapter listAdapter = prefScreen.getRootAdapter();
+ final int itemsCount = listAdapter.getCount();
+ for (int itemNumber = 0; itemNumber < itemsCount; ++itemNumber) {
+ if (listAdapter.getItem(itemNumber).equals(categoryRunConditions)) {
+ // Simulates click on the sub-preference
+ prefScreen.onItemClick(null, null, itemNumber, 0);
+ break;
+ }
+ }
+ }
}
@Override
@@ -317,22 +364,20 @@ public class SettingsActivity extends SyncthingActivity {
public boolean onRunConditionPreferenceChange(Preference preference, Object o) {
switch (preference.getKey()) {
- case Constants.PREF_ALWAYS_RUN_IN_BACKGROUND:
- boolean value = (Boolean) o;
- mAlwaysRunInBackground.setSummary((value)
- ? R.string.always_run_in_background_enabled
- : R.string.always_run_in_background_disabled);
- mSyncOnlyCharging.setEnabled(value);
- mSyncOnlyWifi.setEnabled(value);
- mSyncOnlyOnSSIDs.setEnabled(false);
- // Uncheck items when disabled, so it is clear they have no effect.
- if (!value) {
- mSyncOnlyCharging.setChecked(false);
- mSyncOnlyWifi.setChecked(false);
- }
+ case Constants.PREF_POWER_SOURCE:
+ mPowerSource.setValue(o.toString());
+ preference.setSummary(mPowerSource.getEntry());
break;
- case Constants.PREF_SYNC_ONLY_WIFI:
- mSyncOnlyOnSSIDs.setEnabled((Boolean) o);
+ case Constants.PREF_RUN_ON_WIFI:
+ mRunOnMeteredWifi.setEnabled((Boolean) o);
+ mWifiSsidWhitelist.setEnabled((Boolean) o);
+ break;
+ case Constants.PREF_WIFI_SSID_WHITELIST:
+ String wifiSsidSummary = TextUtils.join(", ", (Set) o);
+ preference.setSummary(TextUtils.isEmpty(wifiSsidSummary) ?
+ getString(R.string.run_on_all_wifi_networks) :
+ getString(R.string.run_on_whitelisted_wifi_networks, wifiSsidSummary)
+ );
break;
}
mPendingRunConditions = true;
diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/StateDialogActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/StateDialogActivity.java
index 7a0fe7e7..f91e2c51 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/activities/StateDialogActivity.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/StateDialogActivity.java
@@ -98,7 +98,9 @@ public abstract class StateDialogActivity extends SyncthingActivity {
.setMessage(R.string.syncthing_disabled_message)
.setPositiveButton(R.string.syncthing_disabled_change_settings,
(dialogInterface, i) -> {
- startActivity(new Intent(this, SettingsActivity.class));
+ Intent intent = new Intent(this, SettingsActivity.class);
+ intent.putExtra(SettingsActivity.EXTRA_OPEN_SUB_PREF_SCREEN, "category_run_conditions");
+ startActivity(intent);
}
)
.setNegativeButton(R.string.exit,
diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/Constants.java b/app/src/main/java/com/nutomic/syncthingandroid/service/Constants.java
index 45222a00..4285e809 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/service/Constants.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/service/Constants.java
@@ -10,12 +10,19 @@ public class Constants {
public static final String FILENAME_SYNCTHING_BINARY = "libsyncthing.so";
- public static final String PREF_FIRST_START = "first_start";
+ // Preferences - Run conditions
public static final String PREF_ALWAYS_RUN_IN_BACKGROUND = "always_run_in_background";
- public static final String PREF_SYNC_ONLY_WIFI = "sync_only_wifi";
- public static final String PREF_SYNC_ONLY_WIFI_SSIDS = "sync_only_wifi_ssids_set";
- public static final String PREF_SYNC_ONLY_CHARGING = "sync_only_charging";
+ public static final String PREF_RUN_ON_MOBILE_DATA = "run_on_mobile_data";
+ public static final String PREF_RUN_ON_WIFI = "run_on_wifi";
+ public static final String PREF_RUN_ON_METERED_WIFI = "run_on_metered_wifi";
+ public static final String PREF_WIFI_SSID_WHITELIST = "wifi_ssid_whitelist";
+ public static final String PREF_POWER_SOURCE = "power_source";
public static final String PREF_RESPECT_BATTERY_SAVING = "respect_battery_saving";
+ public static final String PREF_RESPECT_MASTER_SYNC = "respect_master_sync";
+ public static final String PREF_RUN_IN_FLIGHT_MODE = "run_in_flight_mode";
+
+ // Preferences - Behaviour
+ public static final String PREF_FIRST_START = "first_start";
public static final String PREF_START_INTO_WEB_GUI = "start_into_web_gui";
public static final String PREF_USE_ROOT = "use_root";
public static final String PREF_NOTIFICATION_TYPE = "notification_type";
diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/RunConditionMonitor.java b/app/src/main/java/com/nutomic/syncthingandroid/service/RunConditionMonitor.java
index a30a6ab3..4b4bfd79 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/service/RunConditionMonitor.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/service/RunConditionMonitor.java
@@ -2,10 +2,12 @@ package com.nutomic.syncthingandroid.service;
import android.annotation.TargetApi;
import android.content.BroadcastReceiver;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
+import android.content.SyncStatusObserver;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
@@ -37,6 +39,18 @@ public class RunConditionMonitor {
private static final String TAG = "RunConditionMonitor";
+ private static final String POWER_SOURCE_AC_BATTERY = "ac_and_battery_power";
+ private static final String POWER_SOURCE_AC = "ac_power";
+ private static final String POWER_SOURCE_BATTERY = "battery_power";
+
+ private @Nullable Object mSyncStatusObserverHandle = null;
+ private final SyncStatusObserver mSyncStatusObserver = new SyncStatusObserver() {
+ @Override
+ public void onStatusChanged(int which) {
+ updateShouldRunDecision();
+ }
+ };
+
public interface OnRunConditionChangedListener {
void onRunConditionChanged(boolean shouldRun);
}
@@ -80,12 +94,20 @@ public class RunConditionMonitor {
new IntentFilter(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED));
}
+ // SyncStatusObserver to monitor android's "AutoSync" quick toggle.
+ mSyncStatusObserverHandle = ContentResolver.addStatusChangeListener(
+ ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS, mSyncStatusObserver);
+
// Initially determine if syncthing should run under current circumstances.
updateShouldRunDecision();
}
public void shutdown() {
Log.v(TAG, "Shutting down");
+ if (mSyncStatusObserverHandle != null) {
+ ContentResolver.removeStatusChangeListener(mSyncStatusObserverHandle);
+ mSyncStatusObserverHandle = null;
+ }
mReceiverManager.unregisterAllReceivers(mContext);
}
@@ -134,64 +156,106 @@ public class RunConditionMonitor {
*/
private boolean decideShouldRun() {
// Get run conditions preferences.
- boolean prefAlwaysRunInBackground = mPreferences.getBoolean(Constants.PREF_ALWAYS_RUN_IN_BACKGROUND, false);
- boolean prefRespectPowerSaving = mPreferences.getBoolean(Constants.PREF_RESPECT_BATTERY_SAVING, true);
- boolean prefRunOnlyOnWifi= mPreferences.getBoolean(Constants.PREF_SYNC_ONLY_WIFI, false);
- boolean prefRunOnlyWhenCharging = mPreferences.getBoolean(Constants.PREF_SYNC_ONLY_CHARGING, false);
- Set whitelistedWifiSsids = mPreferences.getStringSet(Constants.PREF_SYNC_ONLY_WIFI_SSIDS, new HashSet<>());
+ boolean prefRunOnMobileData= mPreferences.getBoolean(Constants.PREF_RUN_ON_MOBILE_DATA, false);
+ boolean prefRunOnWifi= mPreferences.getBoolean(Constants.PREF_RUN_ON_WIFI, true);
+ boolean prefRunOnMeteredWifi= mPreferences.getBoolean(Constants.PREF_RUN_ON_METERED_WIFI, false);
+ Set whitelistedWifiSsids = mPreferences.getStringSet(Constants.PREF_WIFI_SSID_WHITELIST, new HashSet<>());
boolean prefWifiWhitelistEnabled = !whitelistedWifiSsids.isEmpty();
+ boolean prefRunInFlightMode = mPreferences.getBoolean(Constants.PREF_RUN_IN_FLIGHT_MODE, false);
+ String prefPowerSource = mPreferences.getString(Constants.PREF_POWER_SOURCE, POWER_SOURCE_AC_BATTERY);
+ boolean prefRespectPowerSaving = mPreferences.getBoolean(Constants.PREF_RESPECT_BATTERY_SAVING, true);
+ boolean prefRespectMasterSync = mPreferences.getBoolean(Constants.PREF_RESPECT_MASTER_SYNC, false);
+
+ // PREF_POWER_SOURCE
+ switch (prefPowerSource) {
+ case POWER_SOURCE_AC:
+ if (!isOnAcPower()) {
+ Log.v(TAG, "decideShouldRun: POWER_SOURCE_AC && !isOnAcPower");
+ return false;
+ }
+ break;
+ case POWER_SOURCE_BATTERY:
+ if (isOnAcPower()) {
+ Log.v(TAG, "decideShouldRun: POWER_SOURCE_BATTERY && isOnAcPower");
+ return false;
+ }
+ break;
+ case POWER_SOURCE_AC_BATTERY:
+ default:
+ break;
+ }
// Power saving
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (prefRespectPowerSaving && isPowerSaving()) {
+ Log.v(TAG, "decideShouldRun: prefRespectPowerSaving && isPowerSaving");
return false;
}
}
- // Always run in background
- if (!prefAlwaysRunInBackground) {
- /**
- * User did not specify run conditions in the options.
- * The app is displaying a foreground activity and syncthing should run.
- */
- Log.v(TAG, "decideShouldRun: !prefAlwaysRunInBackground");
+ // Android global AutoSync setting.
+ if (prefRespectMasterSync && !ContentResolver.getMasterSyncAutomatically()) {
+ Log.v(TAG, "decideShouldRun: prefRespectMasterSync && !getMasterSyncAutomatically");
+ return false;
+ }
+
+ // Run on mobile data.
+ if (prefRunOnMobileData && isMobileDataConnection()) {
+ Log.v(TAG, "decideShouldRun: prefRunOnMobileData && isMobileDataConnection");
return true;
}
- // Run only when charging.
- if (prefRunOnlyWhenCharging && !isCharging()) {
- Log.v(TAG, "decideShouldRun: prefRunOnlyWhenCharging && !isCharging");
- return false;
+ // Run on wifi.
+ if (prefRunOnWifi && isWifiOrEthernetConnection()) {
+ if (prefRunOnMeteredWifi) {
+ // 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 {
+ // Check if we are on a non-metered wifi and if wifi whitelist run condition is met.
+ if (!isMeteredNetworkConnection() && wifiWhitelistConditionMet(prefWifiWhitelistEnabled, whitelistedWifiSsids)) {
+ Log.v(TAG, "decideShouldRun: prefRunOnWifi && isWifiOrEthernetConnection && !prefRunOnMeteredWifi && !isMeteredNetworkConnection && wifiWhitelistConditionMet");
+ return true;
+ }
+ }
}
- // Run only on wifi.
- if (prefRunOnlyOnWifi && !isWifiOrEthernetConnection()) {
- // Not on wifi.
- Log.v(TAG, "decideShouldRun: prefRunOnlyOnWifi && !isWifiOrEthernetConnection");
- return false;
- }
-
- // Run only on whitelisted wifi ssids.
- if (prefRunOnlyOnWifi && prefWifiWhitelistEnabled) {
- // Wifi connection detected. Wifi ssid whitelist enabled.
- Log.v(TAG, "decideShouldRun: prefRunOnlyOnWifi && prefWifiWhitelistEnabled");
- return isWifiConnectionWhitelisted(whitelistedWifiSsids);
+ // Run in flight mode.
+ if (prefRunInFlightMode && isFlightMode()) {
+ Log.v(TAG, "decideShouldRun: prefRunInFlightMode && isFlightMode");
+ return true;
}
/**
- * Respect power saving, device is not in power-save mode.
- * Always run in background is the only pref that is enabled.
- * Run only when charging, charging.
- * Run only on wifi, wifi connection detected, wifi ssid whitelist disabled.
+ * If none of the above run conditions matched, don't run.
*/
- Log.v(TAG, "decideShouldRun: return true");
- return true;
+ Log.v(TAG, "decideShouldRun: return false");
+ return false;
+ }
+
+ /**
+ * Return whether the wifi whitelist run condition is met.
+ * Precondition: An active wifi connection has been detected.
+ */
+ private boolean wifiWhitelistConditionMet(boolean prefWifiWhitelistEnabled,
+ Set whitelistedWifiSsids) {
+ if (!prefWifiWhitelistEnabled) {
+ Log.v(TAG, "handleWifiWhitelist: !prefWifiWhitelistEnabled");
+ return true;
+ }
+ if (isWifiConnectionWhitelisted(whitelistedWifiSsids)) {
+ Log.v(TAG, "handleWifiWhitelist: isWifiConnectionWhitelisted");
+ return true;
+ }
+ return false;
}
/**
* Functions for run condition information retrieval.
*/
- private boolean isCharging() {
+ private boolean isOnAcPower() {
Intent batteryIntent = mContext.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
int status = batteryIntent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
return status == BatteryManager.BATTERY_STATUS_CHARGING ||
@@ -212,6 +276,48 @@ public class RunConditionMonitor {
return powerManager.isPowerSaveMode();
}
+ private boolean isFlightMode() {
+ ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo ni = cm.getActiveNetworkInfo();
+ return ni == null;
+ }
+
+ private boolean isMeteredNetworkConnection() {
+ ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo ni = cm.getActiveNetworkInfo();
+ if (ni == null) {
+ // In flight mode.
+ return false;
+ }
+ if (!ni.isConnected()) {
+ // No network connection.
+ return false;
+ }
+ return cm.isActiveNetworkMetered();
+ }
+
+ private boolean isMobileDataConnection() {
+ ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo ni = cm.getActiveNetworkInfo();
+ if (ni == null) {
+ // In flight mode.
+ return false;
+ }
+ if (!ni.isConnected()) {
+ // No network connection.
+ return false;
+ }
+ switch (ni.getType()) {
+ case ConnectivityManager.TYPE_BLUETOOTH:
+ case ConnectivityManager.TYPE_MOBILE:
+ case ConnectivityManager.TYPE_MOBILE_DUN:
+ case ConnectivityManager.TYPE_MOBILE_HIPRI:
+ return true;
+ default:
+ return false;
+ }
+ }
+
private boolean isWifiOrEthernetConnection() {
ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml
index 54313844..b5d39e00 100644
--- a/app/src/main/res/values-bg/strings.xml
+++ b/app/src/main/res/values-bg/strings.xml
@@ -149,12 +149,8 @@
Резервно копие
Дебъг
Експериментални
- Постоянна работа на заден план
- Постоянно синхронизиране, според следващите опции.
- Синхронизиране само след стартиране на Syncthing. Може бъде спряно от меню бутона \"Изход\".
- Ограничаване до определени WiFi мрежи
За да изберете мрежа, моля включете WiFi
Избор на папка, за напреднали
Изберете папка, от устройството, за синхронизиране
diff --git a/app/src/main/res/values-ca-rES/strings.xml b/app/src/main/res/values-ca-rES/strings.xml
index 5572be7e..2c2d98b9 100644
--- a/app/src/main/res/values-ca-rES/strings.xml
+++ b/app/src/main/res/values-ca-rES/strings.xml
@@ -167,14 +167,8 @@ Ens podeu informar dels problemes que trobeu a través de Github.
Còpia de seguretat
Depuració
Experimental
- Executa sempre en segon pla
- El Syncthing s\'executa contínuament en segon pla i seguint les preferències indicades a sota.
- El Syncthing només s\'executa quan l\'inicieu manualment, i es pot aturar amb el botó del menú.
- Executa només durant la càrrega
- Executa només amb wifi
- Restringeix a xarxes wifi concretes
Enceneu el WiFi per seleccionar xarxes.
Heu de proporcionar el permís d\'UBICACIÓ per poder fer això.
Calen permisos
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index e51e7383..6f6fd8c0 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -163,14 +163,8 @@ Všechny zaznamenané chyby prosím hlašte přes Github.
Záloha
Ladění
Experimentální
- Vždy spuštěné na pozadí
- Syncthing poběží vždy v pozadí, podle nastavení níže.
- Syncthing poběží pouze pokud bude ručně spuštěn a může být ukončen tlačítkem z menu.
- Spustit pouze při nabíjení
- Spustit pouze na wifi
- Omezit na vybrané sítě wifi
Pro výběr sítí prosím zapněte WiFi.
Dodržovat nastavení úspory baterie z Androidu
Vypnout Syncthing pokud je aktivní režim úspory baterie
diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml
index 2af0aabd..5bedf7dc 100644
--- a/app/src/main/res/values-da/strings.xml
+++ b/app/src/main/res/values-da/strings.xml
@@ -159,14 +159,8 @@ Vær venlig at rapportere ethvert problem, du støder på, via Github.
Backup
Debug
Eksperimentalt
- Kør altid i baggrunden
- Syncthing kører altid i baggrunden, ifølge nedenstående indstillinger.
- Syncthing kører kun hvis eksplicit staret og kan stoppes gennem menu knappen.
- Synkronisér kun under opladning
- Synkronisér kun gennem WiFi
- Begræns til specifikke netværk
Vær venlig at slukke WiFi for at vælge netværk.
Respekter Android battery saving indstillinger
Deaktiver Syncthing hvis battery saving er aktiv
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 91647cd0..6cdf7222 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -175,14 +175,8 @@ Bitte melden Sie auftretende Probleme via GitHub.
Datensicherung
Fehleranalyse
Experimentell
- Immer im Hintergrund ausführen
- Syncthing läuft immer im Hintergrund, entsprechend den untenstehenden Einstellungen.
- Syncthing läuft nur wenn es explizit gestartet wird und kann über das Menü gestoppt werden.
- Nur beim Aufladen aktiv
- Nur mit WLAN aktiv
- Nur in bestimmten WLAN Netzwerken
Bitte WLAN aktivieren, um eines zu wählen.
Bitte gewähre die Standort-Berechtigung, um diese Funktion nutzen zu können.
Berechtigung benötigt
diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml
index d57945cb..6f1b0dfc 100644
--- a/app/src/main/res/values-el/strings.xml
+++ b/app/src/main/res/values-el/strings.xml
@@ -160,14 +160,8 @@
Αντίγραφο ασφαλείας
Αποσφαλμάτωση
Πειραματικά
- Να εκτελείται πάντα στο παρασκήνιο
- Το Syncthing θα εκτελείται συνεχώς στο παρασκήνιο σύμφωνα με τις παρακάτω ρυθμίσεις.
- Το Syncthing θα εκτελείται μόνο αν εκκινηθεί από τον χρήστη και μπορεί να τερματιστεί από το κουμπί του μενού.
- Εκτέλεση μόνο κατά τη φόρτιση
- Εκτέλεση μόνο μέσω WiFi
- Περιορισμός σε συγκεκριμένα δίκτυα WiFi
Παρακαλώ ενεργοποιήστε το WiFi για να επιλέξετε δίκτυα.
Υπακοή στη ρύθμιση εξοικονόμησης ενέργειας του Android
Απενεργοποίηση του Syncthing όταν είναι ενεργή η λειτουργία εξοικονόμησης ενέργειας
diff --git a/app/src/main/res/values-es-rMX/strings.xml b/app/src/main/res/values-es-rMX/strings.xml
index e86d3720..ef7ddae0 100644
--- a/app/src/main/res/values-es-rMX/strings.xml
+++ b/app/src/main/res/values-es-rMX/strings.xml
@@ -135,12 +135,8 @@
Configuración
Opciones de Syncthing
Experimental
- Siempre ejecutar en el fondo
- Syncthing siempre se ejecuta en el fondo, de acuerdo a las preferencias debajo.
- Syncthing sólo se ejecuta cuando es explícitamente iniciado, y puede ser detenido usando el botón en el menú.
- Restringir a ciertas redes wifi
Por favor encienda el WiFi para seleccionar redes.
Usar el avanzado Seleccionador de Carpetas
Seleccionar cualquier carpeta en el dispositivo para sincronizar
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 0a081301..7ef72de8 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -149,12 +149,8 @@
Copia de seguridad
Depuración
Experimental
- Ejecutar siempre en segundo plano
- Syncthing se ejecutará siempre en segundo plano, de acuerdo a la siguiente configuración.
- Syncthing sólo se ejecutará cuando se inicie explícitamente, y puede ser detenido por el botón de menú.
- Restringir a determinadas redes wifi
Por favor enciende el wifi para seleccionar redes.
Respeta la configuración de ahorro de batería de Android
Desactivar sincronización si el ahorro de batería está activo
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index aed133f4..070145b5 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -160,14 +160,8 @@ Ilmoitathan ystävällisesti kaikista havaitsemistasi ongelmista Githubin kautta
Varmuuskopio
Vianhaku
Kokeellinen
- Aja aina taustalla
- Synthing ajetaan aina taustalla alla olevien asetusten mukaan.
- Syncthing käy vain kun se on erikseen käynnistetty, ja se voidaan sammuttaa valikon painikkeella.
- Aja ainoastaan latauksen aikana
- Aja ainoastaan Wifi-yhteydellä
- Rajoita tiettyihin Wifi-verkkoihin
Laita Wifi päälle valitaksesi verkkoja.
Noudata Androidin virransäästöasetusta
Poista Syncthing käytöstä jos virransäästö on käytössä
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 4518dde0..b7462bea 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -168,14 +168,8 @@ S\'il vous plaît, soumettez les problèmes que vous rencontrez via Github.Sauvegarde
Debug
Expérimental
- Fonctionner en tâche de fond.
- Syncthing continue à fonctionner en tâche de fond, selon les réglages dans les paramètres.
- Syncthing ne fonctionne que si vous le lancez manuellement, et s\'arrête par le bouton quitter.
- Exécuter uniquement si branché en recharge
- Exécuter uniquement en WiFi
- Limiter à certains réseaux WiFi
Veuillez activer le WiFi pour sélectionner un réseau
Vous devez accorder la permission LOCALISATION pour utiliser cette fonctionnalité.
Permission requise
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index e978822c..8869ea24 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -173,14 +173,8 @@ Néhány eszközön extra alkalmazás-leállító alkalmazást telepített fel a
Biztonsági mentés
Hibakeresés
Kísérleti
- Mindig fusson a háttérben
- A Syncthing folyamatosan fut a háttérben, a lenti beállításoknak megfelelően.
- A Syncthing csak kifejezett kérésre indul, melyet a menüből le lehet állítani.
- Csak töltés közben fusson
- Csak wifi hálózat esetén fusson
- Korlátozás bizonyos wifi hálózatokra
Hálózat választásához kapcsold be a WiFit.
A funkció használatához engedélyezni kell a hozzáférést a földrajzi helyhez
Hozzáférés szükséges
diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml
index 676913b8..f86c94de 100644
--- a/app/src/main/res/values-in/strings.xml
+++ b/app/src/main/res/values-in/strings.xml
@@ -157,14 +157,8 @@ Jika ada masalah silakan laporkan lewat Github.
Backup
Debug
Ujicoba
- Sellau jalankan di background
- Syncthing selalu berjalan di background, menurut pengaturan di bawah.
- Syncthing hanya berjalan jika diaktifkan, dan bisa dihentikan lewat tombol menu.
- Jalankan hanya saat mengisi baterai
- Jalankan hanya saat menggunakan wifi
- Batasi pada jaringan wifi tertentu
Mohon aktifkan WiFi untuk memilih jaringan.
Ikuti pengaturan penghematan baterai Android
Matikan Syncthing jika penghematan baterai sedang aktif
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 5ed67446..d7b39c56 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -168,14 +168,8 @@ Si prega di segnalare eventuali problemi che si incontrano via Github.
Backup
Debug
Sperimentale
- Esegui sempre in background
- Syncthing è sempre in esecuzione in modalità background.
- Syncthing si attiva solo quando viene avviato manualmente e si arresta utilizzando il pulsante del menu.
- Esegui solo quando in carica
- Esegui solo con wifi
- Solo determinate reti wifi
Si prega di attivare il WiFi per selezionare le reti.
È necessario concedere l\'autorizzazione alla LOCALIZZAZIONE per utilizzare questa funzione.
Autorizzazione richiesta
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 5da0e66d..f26047d5 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -160,14 +160,8 @@
バックアップ
デバッグ
実験的
- 常にバックグラウンドで実行
- 以下の設定に応じて常にバックグラウンドで実行されます。
- 明示的に開始したときのみ同期を実行し、メニューから停止することができます。
- 充電中のみ実行
- Wi-Fi 接続時のみ実行
- 特定の Wi-Fi ネットワークに制限する
ネットワークを選択するために Wi-Fi をオンにしてください。
Android の節電設定に従う
バッテリー節約が有効な場合は、Syncthing を無効にします
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 4e6d01de..bfae8487 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -159,14 +159,8 @@
백업
디버그
실험적인 기능
- 백그라운드에서 항상 실행
- Syncthing이 항상 백그라운드에서 실행되도록, 다음의 설정을 변경할 수 있습니다.
- Syncthing은 제대로 시작된 경우에만 작동하며, 메뉴 버튼을 눌러 정지할 수 있습니다.
- 충전시에만 작동
- WiFi에서만 작동
- 특정 WI-FI 네트워크로 제한하기
WI-FI를 활성화하고 네트워크를 선택해주세요.
안드로이드 배터리 절약 설정 우선
배터리 절약 기능이 작동중인 경우 Syncthing 비활성화
diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml
index 4edba0a6..53c1521d 100644
--- a/app/src/main/res/values-nb/strings.xml
+++ b/app/src/main/res/values-nb/strings.xml
@@ -136,12 +136,8 @@
Innstillinger
Valg for Syncthing
Eksperimentelt
- Kjør alltid i bakgrunnen
- Syncthing kjører alltid i bakgrunnen, i henhold til valgene nedenfor.
- Syncthing kjører bare når eksplisitt startet, og kan stoppes med meny-knappen.
- Begrens til visse wifi-nettverk
Vennligst skru på WiFi for å velge nettverk.
Bruk avansert mappevelger
Velg en mappe på enheten for synkronisering
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 2d79e464..ee3975b9 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -168,14 +168,8 @@ Als je problemen tegenkomt, meld ze dan via GitHub.
Back-up
Debug
Experimenteel
- Altijd draaien in achtergrond
- Syncthing draait altijd in de achtergrond, volgens de hieronder weergegeven voorkeuren.
- Syncthing draait enkel wanneer expliciet gestart, en kan gestopt worden door de menu-knop.
- Enkel uitvoeren tijdens opladen
- Enkel uitvoeren via wifi
- Beperken tot bepaalde wifinetwerken
Schakel wifi in om netwerken te selecteren.
Geef de LOCATIE-toestemming om deze functie te gebruiken.
Toestemming vereist
diff --git a/app/src/main/res/values-nn/strings.xml b/app/src/main/res/values-nn/strings.xml
index a5882d72..6edeb939 100644
--- a/app/src/main/res/values-nn/strings.xml
+++ b/app/src/main/res/values-nn/strings.xml
@@ -136,12 +136,8 @@
Innstillingar
Syncthing-innstillingar
Eksperiment
- Køyr alltid i bakgrunnen
- Syncthing køyrer alltid i bakgrunnen, i tråd med innstillingane under.
- Syncthing køyrer berre når ho blir uttrykkeleg starta, og kan bli stoppa frå menyen.
- Avgrens til visse WiFi-nettverk
Skru på WiFi for å velje nettverk.
Bruk avansert mappeveljar
Vel kva mappe som helst for synkronisering
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 347d4d5e..2d240a55 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -163,14 +163,8 @@ Proszę zgłaszać napotkane błędy programu za pośrednictwem serwisu Github.<
Kopia zapasowa
Diagnozowanie błędów
Eksperymentalne
- Działanie w tle
- Uruchamia program w tle zgodnie z poniższymi preferencjami
- Uruchamia program ręcznie i kończy jego działanie przyciskiem w menu
- Działaj tylko w trakcie ładowania
- Synchronizuj tylko przez WiFi
- Ogranicz do określonych sieci WiFi
Proszę włącz WiFi dla wybranych sieci
Respektuj ustawienia oszczędzania energii Androida
Wyłącz Syncthing, jeśli włączone jest oszczędzanie energii
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index fb779243..ef9f800d 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -168,14 +168,8 @@ Por favor, nos avise sobre quaisquer problemas que você encontrar via Github.
Backup
Depuração
Configurações experimentais
- Sempre rodar em segundo plano
- O Syncthing sempre rodará em segundo plano de acordo com as preferências abaixo.
- O Syncthing sempre rodará quando iniciado manualmente e pode ser parado pelo botão de menu.
- Rodar somente durante a carga do aparelho
- Rodar somente com o aparelho conectado ao Wi-Fi
- Limitar a certas redes WiFi
Ligue o WiFi para selecionar as redes
Você precisa dar permissão de localização para usar esse recurso.
Permissão requerida
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 487c8539..f8e4f170 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -152,12 +152,8 @@ Reporte, através do Github, quaisquer problemas que encontre, por favor.Cópia de segurança
Depuração
Experimental
- Correr sempre em segundo plano
- Syncthing corre sempre em segundo plano, de acordo com as preferências abaixo.
- Syncthing apenas corre quando iniciado explicitamente e pode ser parado com o botão do menu.
- Restringir a certas redes wifi
Ligue o WiFi para seleccionar redes.
Usar selector de pasta avançado
Seleccione qualquer pasta no dispositivo para sincronizar
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index 2d8f1cd6..165e1c32 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -176,14 +176,8 @@ Vă rugăm să raportați orice problemă întâlniți, prin intermediul GitHub.
Copie de rezervă
Depanare
Experimental
- Rulează mereu în fundal
- Syncthing v-a rula mereu în fundal, conform setării de mai jos.
- Syncthing v-a rula doar când e pornit explicit și poate fi oprit din buton din meniu.
- Rulează numai când se încarcă
- Rulează numai prin Wi-Fi
- Restricționează la anumite rețele Wi-Fi
VA rugăm să activați Wi-Fi pentru a selecta rețelele.
Trebuie să permiteți accesul la LOCAȚIE pentru a putea folosi această caracteristică.
Necesită permisiunea
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 30fc2326..4c667f71 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -170,14 +170,8 @@
Резервная копия
Отладка
Экспериментальное
- Фоновый режим
- Автозапуск при перезагрузке устройства и работа в фоне
- Syncthing работает только когда запущен специально и может быть остановлен кнопкой в меню.
- Синхронизация только во время зарядки
- Синхронизация только по Wi-Fi
- Ограничить определёнными wifi сетями
Включите WiFi, чтобы выбрать сети
Вы должны разрешить позиционирование для использования данной функции
Требуется разрешение
diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml
index 8e26779e..2d4f0ad3 100644
--- a/app/src/main/res/values-sk/strings.xml
+++ b/app/src/main/res/values-sk/strings.xml
@@ -129,11 +129,8 @@
Nastavenia
Nastavenia Syncthing
- Vždy bežať na pozadí
- Syncthing vždy beží na pozadí, podla nasledovných nastavení.
- Syncthing beží len ak je ručne spustené a môže byť vypnuté pomocou tlačítka v menu.
Použiť rozšírený dialóg pre volbu adresára
Vyberte ľubovolný adresár pre synchronizáciu
Spúšťať Syncthing s root oprávneniami
diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml
index 227c8aa5..70d7a4f9 100644
--- a/app/src/main/res/values-sv/strings.xml
+++ b/app/src/main/res/values-sv/strings.xml
@@ -168,14 +168,8 @@ Vänligen rapportera eventuella problem du stöter på via Github.
Säkerhetskopiera
Felsök
Experimentell
- Kör alltid i bakgrunden
- Syncthing körs alltid i bakgrunden, enligt inställningar nedan.
- Syncthing körs bara när den uttryckligen har startats, och kan stoppas genom menyknapp.
- Kör endast vid laddning
- Kör endast på wifi
- Begränsa till vissa wifi-nätverk
Slå på wifi för att välja nätverk.
Du måste ge tillstånd för PLATS för att använda den här funktionen.
Behörighet krävs
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index efb39628..041e7023 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -151,12 +151,8 @@ Eğer herhangi bir sorunla karşılaşırsan Github aracılığıyla bildir.Yedekleme
Hata ayıklama
Deneysel
- Her zaman arka planda çalış
- Syncthing, her zaman aşağıdaki tercihlere göre arka planda çalışır.
- Syncthing, yalnızca doğrudan başlatıldığında çalışır ve menü tuşu tarafından durdurulur.
- Belirlenmiş kablosuz ağlarla sınırlandır
Ağ seçmek için lütfen kablosuz bağlantınızı açın.
Gelişmiş Klasör Seçici kullan
Eşzamanlama yapmak için aygıttan herhangi bir klasör seçin
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index ea41a6db..2e154686 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -130,12 +130,8 @@
Опції Syncthing
Відладка
Експериментальне
- Завжди працювати в фоновому режимі
- Синхронізація лише під час зарядки
- Синхронізація лише через Wi-Fi
- Працювати лише в заданих Wi-Fi мережах
Будь-ласка, увімкніть Wi-Fi, щоби вибрати мережі
Відповідно до налаштувань енергозбереження пристрою в системі
Заборонити Syncthing під час режиму енергозбереження пристрою
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index 003cd625..fd2ac998 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -135,12 +135,8 @@
Cài đặt
Tuỳ chọn Syncthing
Thực nghiệm
- Luôn chạy nền
- Syncthing luôn chạy nền theo như tuỳ chỉnh bên dưới.
- Syncthing chỉ chạy khi được bật thủ công và có thể được tắt bởi nút trình đơn.
- Hạn chế với vài mạng wifi nhất định
Hãy bật WiFi để lựa chọn mạng.
S.dụng trình chọn th.mục nâng cao
Chọn bất kỳ th.mục nào trên th.bị để đồng bộ
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index a747dd10..dadb131c 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -162,14 +162,8 @@
备份
调试
实验性
- 总是在后台运行
- Syncthing 会根据下方的偏好运行在后台
- Syncthing 仅在运行后启动同步并且可以通过点按菜单按钮停止
- 仅在充电时运行
- 仅在连着 Wi-Fi 时运行
- 对某些无线网络下限制同步
请打开无线网络连接并选择网络
遵循 Android 电池省电模式设置
禁用 Syncthing 如果省电模式已启用
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 58ab68e8..3db8cb54 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -159,14 +159,8 @@
備份
除錯
實驗性
- 永遠在背景執行
- 根據下列的偏好設定,Syncthing 會永遠在背景執行。
- Syncthing 只會在明確地被要求時才會啟動,且可透過選單的按鈕停止。
- 僅限充電時執行
- 僅限 Wi-Fi
- 限制特定的 Wi-Fi 網路
請開啟 Wi-Fi 來選擇網路
遵守 Android 節省電池設定
如果節省電池啟用,停用 Syncthing
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 1377931f..feb79c9a 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -1,12 +1,20 @@
+
- never
- metadata
- always
+
+
+ - ac_and_battery_power
+ - ac_power
+ - battery_power
+
+
- normal
- low_priority
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 2c991df1..b4db0240 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -298,19 +298,22 @@ Please report any problems you encounter via Github.
Debug
Experimental
- Always run in background
+
+ Run Conditions
+ Use the following options to decide when Syncthing will run.
-
- Syncthing always runs in the background, according to preferences below.
+ Run on mobile data
+ Run when device is connected via the mobile data network. Warning: This can consume a lot of data from your mobile operator data plan if you sync large amounts of data.
-
- Syncthing only runs when explicitly started, and can be stopped by menu button.
+ Run on wifi
+ Run when device is connected to a wifi network.
- Run only when charging
+ Run on metered wifi
+ Run when device is connected to a metered wifi network e.g. a hotspot or tethered network. Attention: This can consume large portion of your data plan if you sync a lot of data.
- Run only on wifi
-
- Restrict to certain wifi networks
+ Run on specified wifi networks
+ Run only on selected wifi networks: %1$s
+ Run on all wifi networks.
Please turn on WiFi to select networks.
@@ -319,9 +322,29 @@ Please report any problems you encounter via Github.
Permission required
Starting with Android 8.1, location access is required to be able to read the WiFi\'s name. You can use this feature only if you grant this permission.
- Respect Android battery saving setting
- Disable Syncthing if battery saving is active
+ Run when device is powered by
+
+ - AC and battery power.
+ - AC power.
+ - Battery power.
+
+
+ Respect Android battery saving setting
+ Disable Syncthing if battery saving is active.
+
+ Respect Android \'Auto-sync data\' setting
+ Disable Syncthing when the quick settings tile \'Auto-sync data\' is toggled off.
+
+ Run when device is in flight mode
+ Enable if your phone has problems detecting manual wifi connections during flight mode.
+
+ Service setting
+ Run Syncthing as a service. Adds a persistent notification to prevent it from being terminated by Android. Checking this option starts Syncthing on operating system startup.
+
+ Start service automatically on boot
+
+
Use advanced Folder Picker
Select any folder on the device for syncing
@@ -608,7 +631,7 @@ Please report any problems you encounter via Github.
Syncthing is disabled
- Do you want to change your preferences?
+ Do you want to change the run conditions?
Change Settings
diff --git a/app/src/main/res/xml/app_settings.xml b/app/src/main/res/xml/app_settings.xml
index 1cc3d319..b444644e 100644
--- a/app/src/main/res/xml/app_settings.xml
+++ b/app/src/main/res/xml/app_settings.xml
@@ -5,24 +5,43 @@
android:title="@string/category_run_conditions"
android:key="category_run_conditions">
-
+
+ android:key="run_on_wifi"
+ android:title="@string/run_on_wifi_title"
+ android:summary="@string/run_on_wifi_summary"
+ android:defaultValue="true" />
+ android:key="wifi_ssid_whitelist"
+ android:title="@string/run_on_whitelisted_wifi_title"
+ android:summary="@null" />
+
+
+
+
+
+
+
+
+
+
+
+