From e4eb1bfe5deda15704ed16347d4b1e5cb4fd8c32 Mon Sep 17 00:00:00 2001 From: Adithya Abraham Philip Date: Tue, 23 Jun 2015 20:20:44 +0530 Subject: [PATCH] set progress message to importing --- .../ui/CreateKeyYubiKeyImportFragment.java | 45 ++----------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyYubiKeyImportFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyYubiKeyImportFragment.java index 298efcc39..ff0ebf7d3 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyYubiKeyImportFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyYubiKeyImportFragment.java @@ -183,45 +183,6 @@ public class CreateKeyYubiKeyImportFragment public void importKey() { - // Message is received after decrypting is done in KeychainService - ServiceProgressHandler saveHandler = new ServiceProgressHandler(getActivity()) { - @Override - public void handleMessage(Message message) { - // handle messages by standard KeychainIntentServiceHandler first - super.handleMessage(message); - - if (message.arg1 == MessageStatus.OKAY.ordinal()) { - // get returned data bundle - Bundle returnData = message.getData(); - - ImportKeyResult result = - returnData.getParcelable(DecryptVerifyResult.EXTRA_RESULT); - - long[] masterKeyIds = result.getImportedMasterKeyIds(); - - // TODO handle masterKeyIds.length != 1...? sorta outlandish scenario - - if (!result.success() || masterKeyIds.length == 0) { - result.createNotify(getActivity()).show(); - return; - } - - Intent intent = new Intent(getActivity(), ViewKeyActivity.class); - // use the imported masterKeyId, not the one from the yubikey, because - // that one might* just have been a subkey of the imported key - intent.setData(KeyRings.buildGenericKeyRingUri(masterKeyIds[0])); - intent.putExtra(ViewKeyActivity.EXTRA_DISPLAY_RESULT, result); - intent.putExtra(ViewKeyActivity.EXTRA_NFC_AID, mNfcAid); - intent.putExtra(ViewKeyActivity.EXTRA_NFC_USER_ID, mNfcUserId); - intent.putExtra(ViewKeyActivity.EXTRA_NFC_FINGERPRINTS, mNfcFingerprints); - startActivity(intent); - getActivity().finish(); - - } - - } - }; - ArrayList keyList = new ArrayList<>(); keyList.add(new ParcelableKeyRing(mNfcFingerprint, null, null)); mKeyList = keyList; @@ -233,9 +194,9 @@ public class CreateKeyYubiKeyImportFragment mKeyserver = cloudPrefs.keyserver; } - // TODO: PHILIP make the progress dialog show importing + super.setProgressMessageResource(R.string.progress_importing); - cryptoOperation(); + super.cryptoOperation(); } @@ -267,7 +228,7 @@ public class CreateKeyYubiKeyImportFragment super.onCryptoOperationError(result); return; } - + Intent intent = new Intent(getActivity(), ViewKeyActivity.class); // use the imported masterKeyId, not the one from the yubikey, because // that one might* just have been a subkey of the imported key