diff --git a/src/com/fsck/k9/K9.java b/src/com/fsck/k9/K9.java index 88de54e93..8b9611f6e 100644 --- a/src/com/fsck/k9/K9.java +++ b/src/com/fsck/k9/K9.java @@ -328,11 +328,7 @@ public class K9 extends Application { } - public static void setServicesEnabled(Context context, Integer wakeLockId) { - setServicesEnabled(context, Preferences.getPreferences(context).getAvailableAccounts().size() > 0, wakeLockId); - } - - public static void setServicesEnabled(Context context, boolean enabled, Integer wakeLockId) { + private static void setServicesEnabled(Context context, boolean enabled, Integer wakeLockId) { PackageManager pm = context.getPackageManager(); diff --git a/src/com/fsck/k9/mail/store/StorageManager.java b/src/com/fsck/k9/mail/store/StorageManager.java index 9c52b7114..ab861ecb8 100644 --- a/src/com/fsck/k9/mail/store/StorageManager.java +++ b/src/com/fsck/k9/mail/store/StorageManager.java @@ -659,6 +659,8 @@ public class StorageManager { sync.writeLock.lock(); sync.unmounting = false; sync.writeLock.unlock(); + + K9.setServicesEnabled(K9.app); } /** @@ -684,7 +686,7 @@ public class StorageManager { } // XXX we should reset mail service ONLY if there are accounts using the storage (this is not done in a regular listener because it has to be invoked afterward) - MailService.actionReset(mApplication, null); + K9.setServicesEnabled(K9.app); } /**