Skip to content

Commit

Permalink
getBooleanDefaultTrue
Browse files Browse the repository at this point in the history
  • Loading branch information
Navid200 committed Sep 15, 2023
1 parent 428b411 commit 95644dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public static boolean isBackupSuitableForAutomatic() {

public static void doCompleteBackupIfEnabled() {
if (Pref.getBooleanDefaultFalse(PREF_AUTO_BACKUP)
&& isBackupSuitableForAutomatic() && ((!Pref.getBooleanDefaultFalse(PREF_AUTO_BACKUP_WIFI)) || (JoH.isLANConnected()))) {
&& isBackupSuitableForAutomatic() && ((!Pref.getBooleanDefaultTrue(PREF_AUTO_BACKUP_WIFI)) || (JoH.isLANConnected()))) {
UserError.Log.e(TAG, "Attempting automatic backup");
val success = doCompleteBackup(new LogStatus());
if (!success) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public static boolean getBooleanDefaultFalse(final String pref) {
return (prefs != null) && (prefs.getBoolean(pref, false));
}

public static boolean getBooleanDefaultTrue(final String pref) {
initializePrefs();
return (prefs != null) && (prefs.getBoolean(pref, true));
}

public static boolean getBoolean(final String pref, boolean def) {
initializePrefs();
return (prefs != null) && (prefs.getBoolean(pref, def));
Expand Down

0 comments on commit 95644dd

Please sign in to comment.