diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-11-13 17:00:09 +0100 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-11-13 17:00:09 +0100 |
commit | 712e526ab56649a252958818b2c1320f81e19142 (patch) | |
tree | d12a5183d70dc74b409bdbfc7d4c6d8aa80048f2 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java | |
parent | 2d7dada8880cff572a995009bc69a0b487b47265 (diff) | |
parent | 816dce0334e8b8d9da3cb00d31d26033b17040a3 (diff) | |
download | open-keychain-712e526ab56649a252958818b2c1320f81e19142.tar.gz open-keychain-712e526ab56649a252958818b2c1320f81e19142.tar.bz2 open-keychain-712e526ab56649a252958818b2c1320f81e19142.zip |
Merge commit '816dce0334e8b8d9da3cb00d31d26033b17040a3'
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java index 7dfb3f3f6..d6ef1be85 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java @@ -701,24 +701,17 @@ public class OpenPgpService extends RemoteService { Intent result = new Intent(); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); - // return public key if requested by defining a output stream - if (outputStream != null) { - boolean requestAsciiArmor = - data.getBooleanExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, false); + boolean requestedKeyData = outputStream != null; + if (requestedKeyData) { + boolean requestAsciiArmor = data.getBooleanExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, false); - ArmoredOutputStream arOutStream = null; try { if (requestAsciiArmor) { - arOutStream = new ArmoredOutputStream(outputStream); - keyRing.encode(arOutStream); - } else { - keyRing.encode(outputStream); + outputStream = new ArmoredOutputStream(outputStream); } + keyRing.encode(outputStream); } finally { try { - if (arOutStream != null) { - arOutStream.close(); - } outputStream.close(); } catch (IOException e) { Log.e(Constants.TAG, "IOException when closing OutputStream", e); |