diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-11 17:10:40 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-11 17:10:40 +0200 |
commit | 5d652e4c418b42eef0517d1110b782908bfd8235 (patch) | |
tree | e2403bf31d1f54f7fb9d0ea635d9a0735aba1abf /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base | |
parent | 244f92ed576666dbe765281997c0da7f64405325 (diff) | |
download | open-keychain-5d652e4c418b42eef0517d1110b782908bfd8235.tar.gz open-keychain-5d652e4c418b42eef0517d1110b782908bfd8235.tar.bz2 open-keychain-5d652e4c418b42eef0517d1110b782908bfd8235.zip |
some bugfixes for new CryptoOperationFragment
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base')
2 files changed, 1 insertions, 63 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CachingCryptoOperationFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CachingCryptoOperationFragment.java index 8ed4cbc87..87c6ee3ca 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CachingCryptoOperationFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CachingCryptoOperationFragment.java @@ -1,19 +1,10 @@ package org.sufficientlysecure.keychain.ui.base; -import android.app.ProgressDialog; -import android.content.Intent; import android.os.Bundle; -import android.os.Message; -import android.os.Messenger; import android.os.Parcelable; -import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.OperationResult; -import org.sufficientlysecure.keychain.service.KeychainNewService; -import org.sufficientlysecure.keychain.service.KeychainService; -import org.sufficientlysecure.keychain.service.ServiceProgressHandler; -import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; public abstract class CachingCryptoOperationFragment <T extends Parcelable, S extends OperationResult> @@ -47,59 +38,6 @@ public abstract class CachingCryptoOperationFragment <T extends Parcelable, S ex protected abstract T createOperationInput(); - protected void cryptoOperation(CryptoInputParcel cryptoInput) { - - if (mCachedActionsParcel == null) { - - mCachedActionsParcel = createOperationInput(); - // this is null if invalid, just return in that case - if (mCachedActionsParcel == null) { - // Notify was created by createCryptoInput. - return; - } - - } - - // Send all information needed to service to edit key in other thread - Intent intent = new Intent(getActivity(), KeychainNewService.class); - - intent.putExtra(KeychainNewService.EXTRA_OPERATION_INPUT, mCachedActionsParcel); - intent.putExtra(KeychainNewService.EXTRA_CRYPTO_INPUT, cryptoInput); - - 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(); - if (returnData == null) { - return; - } - - final OperationResult result = - returnData.getParcelable(OperationResult.EXTRA_RESULT); - - onHandleResult(result); - } - } - }; - - // Create a new Messenger for the communication back - Messenger messenger = new Messenger(saveHandler); - intent.putExtra(KeychainService.EXTRA_MESSENGER, messenger); - - saveHandler.showProgressDialog( - getString(R.string.progress_building_key), - ProgressDialog.STYLE_HORIZONTAL, false); - - getActivity().startService(intent); - - } - protected T getCachedActionsParcel() { return mCachedActionsParcel; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationFragment.java index 637a7dcff..2be162e95 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationFragment.java @@ -184,7 +184,7 @@ public abstract class CryptoOperationFragment <T extends Parcelable, S extends O abstract protected void onCryptoOperationSuccess(S result); protected void onCryptoOperationError(S result) { - result.createNotify(getActivity()).show(this); + result.createNotify(getActivity()).show(); } protected void onCryptoOperationCancelled() { |