mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 19:52:17 -05:00
Fixes Issue 3102 in cooperation with vincent...@gmail.com
Reset service enablement and MailService scheduling whenever a storage medium is mounted or unmounted.
This commit is contained in:
parent
4f59a04fd5
commit
7891b24c31
@ -320,11 +320,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();
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user