diff --git a/app/src/main/java/com/money/manager/ex/sync/SyncBroadcastReceiver.java b/app/src/main/java/com/money/manager/ex/sync/SyncBroadcastReceiver.java index a94aff0c9..a8b05e337 100644 --- a/app/src/main/java/com/money/manager/ex/sync/SyncBroadcastReceiver.java +++ b/app/src/main/java/com/money/manager/ex/sync/SyncBroadcastReceiver.java @@ -34,8 +34,6 @@ public void onReceive(Context context, Intent intent) { Timber.d("receiving a sync intent %s",intent); SyncManager sync = new SyncManager(context); - if (!sync.canSync()) return; - sync.triggerSynchronization(); } } diff --git a/app/src/main/java/com/money/manager/ex/sync/SyncManager.java b/app/src/main/java/com/money/manager/ex/sync/SyncManager.java index 75437c450..fa1e76cfa 100644 --- a/app/src/main/java/com/money/manager/ex/sync/SyncManager.java +++ b/app/src/main/java/com/money/manager/ex/sync/SyncManager.java @@ -105,8 +105,7 @@ public Context getContext() { * @return boolean indicating if auto sync should be done. */ public boolean canSync() { - // file can be manually removed from storage both intenal and external - if (isPhoneStorage() && isRemoteFileAccessible(true ) ) return true; + if (isPhoneStorage()) return true; // check if online if (!isActive()) return false; @@ -122,11 +121,10 @@ public boolean canSync() { return false; } } - - return isRemoteFileAccessible(true ) ; + return true; } - public boolean isRemoteFileAccessible(boolean showAllert) { + public boolean isRemoteFileAccessible(boolean showAlert) { // check if remote file is accessible isRemoteFileAccessibleExist = false; String remotePath = getRemotePath(); @@ -148,7 +146,7 @@ public boolean isRemoteFileAccessible(boolean showAllert) { } if (!isRemoteFileAccessibleExist) { - if (showAllert) { + if (showAlert) { Toast.makeText(getContext(), R.string.remote_unavailable, Toast.LENGTH_SHORT).show(); Timber.i("Remote file is no longer available."); NotificationManager notificationManager = (NotificationManager) getContext()