consolidate: prevent concurrent calls of step 2

This commit is contained in:
Vincent Breitmoser
2014-08-20 19:59:45 +02:00
parent 2a96912a96
commit 475293a116
4 changed files with 126 additions and 102 deletions

View File

@@ -86,21 +86,26 @@ public class KeychainApplication extends Application {
setupAccountAsNeeded(this);
// Update keyserver list as needed
Preferences prefs = Preferences.getPreferences(this);
prefs.updatePreferences();
Preferences.getPreferences(this).updatePreferences();
TlsHelper.addStaticCA("pool.sks-keyservers.net", getAssets(), "sks-keyservers.netCA.cer");
TemporaryStorageProvider.cleanUp(this);
checkConsolidateRecovery();
}
public void checkConsolidateRecovery() {
// restart consolidate process if it has been interruped before
if (prefs.getCachedConsolidate()) {
if (Preferences.getPreferences(this).getCachedConsolidate()) {
// do something which calls ProviderHelper.consolidateDatabaseStep2 with a progressable
Intent consolidateIntent = new Intent(this, ConsolidateDialogActivity.class);
consolidateIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(consolidateIntent);
}
}
public static void setupAccountAsNeeded(Context context) {