diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/cloud/backup/Backup.java b/app/src/main/java/com/eveningoutpost/dexdrip/cloud/backup/Backup.java index a1e2ad3cd8..e274021687 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/cloud/backup/Backup.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/cloud/backup/Backup.java @@ -62,6 +62,7 @@ public class Backup { private static final String TAG = "xDrip-Backup"; private static final String PREF_BACKUP_URI = "backup-document-uri"; public static final String PREF_AUTO_BACKUP = "backup-automatic-enabled"; + public static final String PREF_AUTO_BACKUP_MOBILE = "backup-automatic-mobile"; private static final String XDRIP_CONTENT_TYPE = "xDripBackup://"; private static final String[] dbSuffix = {"-journal", "-shm", "-wal"}; @@ -298,7 +299,7 @@ public static boolean isBackupSuitableForAutomatic() { public static void doCompleteBackupIfEnabled() { if (Pref.getBooleanDefaultFalse(PREF_AUTO_BACKUP) - && isBackupSuitableForAutomatic()) { + && isBackupSuitableForAutomatic() && ((Pref.getBoolean(PREF_AUTO_BACKUP_MOBILE, true)) || (JoH.isLANConnected()))) { UserError.Log.e(TAG, "Attempting automatic backup"); val success = doCompleteBackup(new LogStatus()); if (!success) { diff --git a/app/src/main/res/layout/activity_backup_picker.xml b/app/src/main/res/layout/activity_backup_picker.xml index 74ebb437b4..1c24536302 100644 --- a/app/src/main/res/layout/activity_backup_picker.xml +++ b/app/src/main/res/layout/activity_backup_picker.xml @@ -80,19 +80,23 @@