From 475293a116b5c3f7937bc5075921a2a0cb9c9a29 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Wed, 20 Aug 2014 19:59:45 +0200 Subject: consolidate: prevent concurrent calls of step 2 --- .../sufficientlysecure/keychain/KeychainApplication.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java index 964a15d58..ead29e229 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java @@ -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) { -- cgit v1.2.3