diff options
Diffstat (limited to 'src/org/thialfihar/android/apg/KeyServerQueryActivity.java')
-rw-r--r-- | src/org/thialfihar/android/apg/KeyServerQueryActivity.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/org/thialfihar/android/apg/KeyServerQueryActivity.java b/src/org/thialfihar/android/apg/KeyServerQueryActivity.java index 4ae171266..c6b5a3865 100644 --- a/src/org/thialfihar/android/apg/KeyServerQueryActivity.java +++ b/src/org/thialfihar/android/apg/KeyServerQueryActivity.java @@ -86,7 +86,8 @@ public class KeyServerQueryActivity extends BaseActivity { }); Intent intent = getIntent(); - if (Apg.Intent.LOOK_UP_KEY_ID.equals(intent.getAction())) { + if (Apg.Intent.LOOK_UP_KEY_ID.equals(intent.getAction()) || + Apg.Intent.LOOK_UP_KEY_ID_AND_RETURN.equals(intent.getAction())) { long keyId = intent.getLongExtra(Apg.EXTRA_KEY_ID, 0); if (keyId != 0) { String query = "0x" + Apg.keyToHex(keyId); @@ -168,15 +169,21 @@ public class KeyServerQueryActivity extends BaseActivity { mAdapter.setKeys(mSearchResult); } } else if (mQueryType == Id.query.get) { - if (mKeyData != null) { - Intent intent = new Intent(this, PublicKeyListActivity.class); - intent.setAction(Apg.Intent.IMPORT); - intent.putExtra(Apg.EXTRA_TEXT, mKeyData); - Intent orgIntent = getIntent(); - if (Apg.Intent.LOOK_UP_KEY_ID.equals(orgIntent.getAction())) { + Intent orgIntent = getIntent(); + if (Apg.Intent.LOOK_UP_KEY_ID_AND_RETURN.equals(orgIntent.getAction())) { + if (mKeyData != null) { + Intent intent = new Intent(); + intent.putExtra(Apg.EXTRA_TEXT, mKeyData); setResult(RESULT_OK, intent); - finish(); } else { + setResult(RESULT_CANCELED); + } + finish(); + } else { + if (mKeyData != null) { + Intent intent = new Intent(this, PublicKeyListActivity.class); + intent.setAction(Apg.Intent.IMPORT); + intent.putExtra(Apg.EXTRA_TEXT, mKeyData); startActivity(intent); } } |