aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java
index bafb086d0..bb45cc7db 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java
@@ -58,10 +58,6 @@ public class PgpImportExport {
private ProviderHelper mProviderHelper;
- public static final int RETURN_OK = 0;
- public static final int RETURN_BAD = -2;
- public static final int RETURN_UPDATED = 1;
-
public PgpImportExport(Context context, Progressable progressable) {
super();
this.mContext = context;
@@ -118,10 +114,9 @@ public class PgpImportExport {
if (aos != null) {
aos.close();
}
- if (bos != null) {
- bos.close();
- }
+ bos.close();
} catch (IOException e) {
+ // this is just a finally thing, no matter if it doesn't work out.
}
}
}
@@ -153,10 +148,12 @@ public class PgpImportExport {
}
SaveKeyringResult result = mProviderHelper.savePublicKeyRing(key);
- if (result.updated()) {
- newKeys += 1;
- } else {
+ if (!result.success()) {
+ badKeys += 1;
+ } else if (result.updated()) {
oldKeys += 1;
+ } else {
+ newKeys += 1;
}
} catch (PgpGeneralException e) {