aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2014-10-26 22:00:57 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2014-10-26 22:00:57 +0100
commit082722a3cfbae408ae3df1f27b191c62a212ff2b (patch)
tree147261c28d52c2477b0df036e9bedf62c52bd209 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
parentb8ed54bc699978355ffb5e9802902c6bc19a2e7a (diff)
downloadopen-keychain-082722a3cfbae408ae3df1f27b191c62a212ff2b.tar.gz
open-keychain-082722a3cfbae408ae3df1f27b191c62a212ff2b.tar.bz2
open-keychain-082722a3cfbae408ae3df1f27b191c62a212ff2b.zip
prevent cancel dring consolidate, move logic into progressable
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index 044656a31..a2988f2b2 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -472,8 +472,7 @@ public class KeychainIntentService extends IntentService implements Progressable
// Special: consolidate on secret key import (cannot be cancelled!)
if (result.mSecret > 0) {
- // cannot cancel from here on out!
- sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_PREVENT_CANCEL);
+ // TODO move this into the import operation
providerHelper.consolidateDatabaseStep1(this);
}
@@ -676,6 +675,11 @@ public class KeychainIntentService extends IntentService implements Progressable
setProgress(null, progress, max);
}
+ @Override
+ public void setPreventCancel() {
+ sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_PREVENT_CANCEL);
+ }
+
private InputData createDecryptInputData(Bundle data) throws IOException, PgpGeneralException {
return createCryptInputData(data, DECRYPT_CIPHERTEXT_BYTES);
}