aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2014-03-13 13:40:47 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2014-03-13 13:40:47 +0100
commit9a1ce093bfadd9de33397f15c39a4c6f52a4abd6 (patch)
treedaae15efacae7820d94388e7a5976d7d0eed8348 /OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
parent6af65a2a9b5f90b90bf8752820f40f89241d8014 (diff)
parentf5c50c3896fa0f406ce4b90a9470395eaf6784a4 (diff)
downloadopen-keychain-9a1ce093bfadd9de33397f15c39a4c6f52a4abd6.tar.gz
open-keychain-9a1ce093bfadd9de33397f15c39a4c6f52a4abd6.tar.bz2
open-keychain-9a1ce093bfadd9de33397f15c39a4c6f52a4abd6.zip
Merge remote-tracking branch 'origin/master'
Conflicts: OpenPGP-Keychain/src/main/res/menu/key_list_secret.xml
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index 93238349d..23f489d35 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -56,6 +56,7 @@ import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry;
import org.sufficientlysecure.keychain.util.HkpKeyServer;
import org.sufficientlysecure.keychain.util.InputData;
+import org.sufficientlysecure.keychain.util.KeychainServiceListener;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.ProgressDialogUpdater;
@@ -73,7 +74,7 @@ import android.os.RemoteException;
* data from the activities or other apps, queues these intents, executes them, and stops itself
* after doing them.
*/
-public class KeychainIntentService extends IntentService implements ProgressDialogUpdater {
+public class KeychainIntentService extends IntentService implements ProgressDialogUpdater, KeychainServiceListener {
/* extras that can be given by intent */
public static final String EXTRA_MESSENGER = "messenger";
@@ -712,10 +713,15 @@ public class KeychainIntentService extends IntentService implements ProgressDial
Bundle resultData;
- PgpImportExport pgpImportExport = new PgpImportExport(this, this);
+ PgpImportExport pgpImportExport = new PgpImportExport(this, this, this);
+
resultData = pgpImportExport
.exportKeyRings(keyRingRowIds, keyType, outStream);
+ if(mIsCanceled){
+ boolean isDeleted = new File(outputFile).delete();
+ }
+
sendMessageToHandler(KeychainIntentServiceHandler.MESSAGE_OKAY, resultData);
} catch (Exception e) {
sendErrorToHandler(e);
@@ -903,4 +909,9 @@ public class KeychainIntentService extends IntentService implements ProgressDial
public void setProgress(int progress, int max) {
setProgress(null, progress, max);
}
+
+ @Override
+ public boolean hasServiceStopped() {
+ return mIsCanceled;
+ }
}