From a7f40931473f741c86e34a478f26d064c24ff410 Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 22 Jun 2021 16:04:20 +0200 Subject: [PATCH] Remove unused K9JobManager.schedulePusherRefresh() --- app/core/src/main/java/com/fsck/k9/Account.java | 5 +---- app/core/src/main/java/com/fsck/k9/job/K9JobManager.kt | 4 ---- .../fsck/k9/activity/setup/AccountSetupIncoming.java | 4 ---- .../k9/ui/settings/account/AccountSettingsDataStore.kt | 10 +--------- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/Account.java b/app/core/src/main/java/com/fsck/k9/Account.java index efabef4fd..4e0a35ebf 100644 --- a/app/core/src/main/java/com/fsck/k9/Account.java +++ b/app/core/src/main/java/com/fsck/k9/Account.java @@ -609,11 +609,8 @@ public class Account implements BaseAccount { return folderPushMode; } - public synchronized boolean setFolderPushMode(FolderMode pushMode) { - FolderMode oldPushMode = folderPushMode; - + public synchronized void setFolderPushMode(FolderMode pushMode) { folderPushMode = pushMode; - return pushMode != oldPushMode; } public synchronized boolean isNotifySync() { diff --git a/app/core/src/main/java/com/fsck/k9/job/K9JobManager.kt b/app/core/src/main/java/com/fsck/k9/job/K9JobManager.kt index f2193c7cf..d511c83cb 100644 --- a/app/core/src/main/java/com/fsck/k9/job/K9JobManager.kt +++ b/app/core/src/main/java/com/fsck/k9/job/K9JobManager.kt @@ -20,10 +20,6 @@ class K9JobManager( mailSyncWorkerManager.scheduleMailSync(account) } - fun schedulePusherRefresh() { - // Push is temporarily disabled. See GH-4253 - } - private fun scheduleMailSync() { cancelAllMailSyncJobs() diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java index b2cf079c9..7654c05fc 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java @@ -534,10 +534,6 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener if (resultCode == RESULT_OK) { if (Intent.ACTION_EDIT.equals(getIntent().getAction())) { - boolean isPushCapable = messagingController.isPushCapable(mAccount); - if (isPushCapable && mAccount.getFolderPushMode() != FolderMode.NONE) { - jobManager.schedulePusherRefresh(); - } Preferences.getPreferences(getApplicationContext()).saveAccount(mAccount); finish(); } else { diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt index 4635286c9..c39d5cec8 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt @@ -165,11 +165,7 @@ class AccountSettingsDataStore( reschedulePoll() } } - "folder_push_mode" -> { - if (account.setFolderPushMode(Account.FolderMode.valueOf(value))) { - restartPushers() - } - } + "folder_push_mode" -> account.folderPushMode = Account.FolderMode.valueOf(value) "delete_policy" -> account.deletePolicy = Account.DeletePolicy.valueOf(value) "expunge_policy" -> account.expungePolicy = Account.Expunge.valueOf(value) "max_push_folders" -> account.maxPushFolders = value.toInt() @@ -214,10 +210,6 @@ class AccountSettingsDataStore( jobManager.scheduleMailSync(account) } - private fun restartPushers() { - jobManager.schedulePusherRefresh() - } - private fun extractFolderId(preferenceValue: String): Long? { val folderValue = preferenceValue.substringAfter(FolderListPreference.FOLDER_VALUE_DELIMITER) return if (folderValue == FolderListPreference.NO_FOLDER_VALUE) null else folderValue.toLongOrNull()