aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-03-30 16:40:41 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-03-30 16:40:41 +0200
commitd7b79e55fba170a0fe691f00dbc943d8ecfff33e (patch)
tree229ddba3f98752b0c347ebb1960cadf646aae1e5 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui
parent2050be3995bde67541ceb78050b3c9143907444f (diff)
downloadopen-keychain-d7b79e55fba170a0fe691f00dbc943d8ecfff33e.tar.gz
open-keychain-d7b79e55fba170a0fe691f00dbc943d8ecfff33e.tar.bz2
open-keychain-d7b79e55fba170a0fe691f00dbc943d8ecfff33e.zip
pass CryptoInputParcel independently for SignEncryptOperation
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java8
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java10
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextFragment.java5
3 files changed, 8 insertions, 15 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index a1edf808c..bd52d74cf 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -106,7 +106,7 @@ public abstract class EncryptActivity extends BaseActivity {
startEncrypt(null);
}
- public void startEncrypt(CryptoInputParcel cryptoInput) {
+ public void startEncrypt(final CryptoInputParcel cryptoInput) {
if (!inputIsValid()) {
// Notify was created by inputIsValid.
return;
@@ -117,12 +117,10 @@ public abstract class EncryptActivity extends BaseActivity {
intent.setAction(KeychainIntentService.ACTION_SIGN_ENCRYPT);
final SignEncryptParcel input = createEncryptBundle();
- if (cryptoInput != null) {
- input.setCryptoInput(cryptoInput);
- }
Bundle data = new Bundle();
data.putParcelable(KeychainIntentService.SIGN_ENCRYPT_PARCEL, input);
+ data.putParcelable(KeychainIntentService.EXTRA_CRYPTO_INPUT, cryptoInput);
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
// Message is received after encrypting is done in KeychainIntentService
@@ -151,7 +149,7 @@ public abstract class EncryptActivity extends BaseActivity {
RequiredInputParcel parcel = RequiredInputParcel.createNfcSignOperation(
pgpResult.getNfcHash(),
pgpResult.getNfcAlgo(),
- input.getSignatureTime());
+ cryptoInput.getSignatureTime());
startNfcSign(pgpResult.getNfcKeyId(), parcel);
} else {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java
index 5af353524..7e4c48e10 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java
@@ -93,8 +93,8 @@ public class EncryptFilesFragment extends CryptoOperationFragment {
private long mSigningKeyId = Constants.key.none;
private Passphrase mPassphrase = new Passphrase();
- private ArrayList<Uri> mInputUris = new ArrayList<Uri>();
- private ArrayList<Uri> mOutputUris = new ArrayList<Uri>();
+ private ArrayList<Uri> mInputUris = new ArrayList<>();
+ private ArrayList<Uri> mOutputUris = new ArrayList<>();
private ListView mSelectedFiles;
private SelectedFilesAdapter mAdapter = new SelectedFilesAdapter();
@@ -136,7 +136,7 @@ public class EncryptFilesFragment extends CryptoOperationFragment {
try {
mModeInterface = (IMode) activity;
} catch (ClassCastException e) {
- throw new ClassCastException(activity.toString() + " must be IMode");
+ throw new ClassCastException(activity + " must be IMode");
}
}
@@ -487,12 +487,10 @@ public class EncryptFilesFragment extends CryptoOperationFragment {
intent.setAction(KeychainIntentService.ACTION_SIGN_ENCRYPT);
final SignEncryptParcel input = createEncryptBundle();
- if (cryptoInput != null) {
- input.setCryptoInput(cryptoInput);
- }
Bundle data = new Bundle();
data.putParcelable(KeychainIntentService.SIGN_ENCRYPT_PARCEL, input);
+ data.putParcelable(KeychainIntentService.EXTRA_CRYPTO_INPUT, cryptoInput);
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
// Message is received after encrypting is done in KeychainIntentService
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextFragment.java
index 3303b2c65..7197cf88d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextFragment.java
@@ -344,12 +344,9 @@ public class EncryptTextFragment extends CryptoOperationFragment {
intent.setAction(KeychainIntentService.ACTION_SIGN_ENCRYPT);
final SignEncryptParcel input = createEncryptBundle();
- if (cryptoInput != null) {
- input.setCryptoInput(cryptoInput);
- }
-
final Bundle data = new Bundle();
data.putParcelable(KeychainIntentService.SIGN_ENCRYPT_PARCEL, input);
+ data.putParcelable(KeychainIntentService.EXTRA_CRYPTO_INPUT, cryptoInput);
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
// Message is received after encrypting is done in KeychainIntentService