From 5119ae1b8ef8e738c1f54edbe01c5ff219671caf Mon Sep 17 00:00:00 2001 From: Mohamed Zenadi Date: Tue, 25 Jul 2017 18:24:47 +0100 Subject: remove the most probably the buggiest calls ever --- app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index 05b87b98..32a3ced6 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -394,9 +394,11 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.d(Constants.TAG, "onActivityResult resultCode: " + resultCode); + if (data == null) { setResult(RESULT_CANCELED, null); finish(); + return; } // try again after user interaction @@ -408,14 +410,6 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne * interaction, for example selected key ids. */ switch (requestCode) { - case REQUEST_CODE_ENCRYPT: { - encrypt(data); - break; - } - case REQUEST_CODE_DECRYPT_AND_VERIFY: { - decryptAndVerify(data); - break; - } case REQUEST_CODE_GET_KEY_IDS: getKeyIds(data); break; @@ -423,6 +417,9 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne edit(data); break; } + default: + setResult(RESULT_OK); + finish(); } } else if (resultCode == RESULT_CANCELED) { setResult(RESULT_CANCELED, data); -- cgit v1.2.3