diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileActivity.java | 2 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java | 19 |
2 files changed, 17 insertions, 4 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileActivity.java index 96f8bd983..a5de20986 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileActivity.java @@ -183,7 +183,7 @@ public class EncryptFileActivity extends DrawerActivity implements EncryptActivi // Send all information needed to service to edit key in other thread Intent intent = new Intent(this, KeychainIntentService.class); - intent.setAction(KeychainIntentService.ACTION_ENCRYPT_SIGN); + intent.setAction(KeychainIntentService.ACTION_SIGN_ENCRYPT); intent.putExtra(KeychainIntentService.EXTRA_DATA, createEncryptBundle()); // Message is received after encrypting is done in KeychainIntentService diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java index 6e6e52562..4bf1cad3c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptTextActivity.java @@ -42,6 +42,7 @@ import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; import org.sufficientlysecure.keychain.service.PassphraseCacheService; +import org.sufficientlysecure.keychain.service.results.SignEncryptResult; import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment; import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Notify; @@ -184,7 +185,7 @@ public class EncryptTextActivity extends DrawerActivity implements EncryptActivi // Send all information needed to service to edit key in other thread Intent intent = new Intent(this, KeychainIntentService.class); - intent.setAction(KeychainIntentService.ACTION_ENCRYPT_SIGN); + intent.setAction(KeychainIntentService.ACTION_SIGN_ENCRYPT); intent.putExtra(KeychainIntentService.EXTRA_DATA, createEncryptBundle()); // Message is received after encrypting is done in KeychainIntentService @@ -195,14 +196,26 @@ public class EncryptTextActivity extends DrawerActivity implements EncryptActivi super.handleMessage(message); if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { + + SignEncryptResult result = + message.getData().getParcelable(SignEncryptResult.EXTRA_RESULT); + + // TODO if (result.isPending()) + + if (!result.success()) { + result.createNotify(EncryptTextActivity.this).show(); + return; + } + if (mShareAfterEncrypt) { // Share encrypted message/file startActivity(sendWithChooserExcludingEncrypt(message)); } else { // Copy to clipboard copyToClipboard(message); - Notify.showNotify(EncryptTextActivity.this, - R.string.encrypt_sign_clipboard_successful, Notify.Style.INFO); + result.createNotify(EncryptTextActivity.this).show(); + // Notify.showNotify(EncryptTextActivity.this, + // R.string.encrypt_sign_clipboard_successful, Notify.Style.INFO); } } } |