Fixes for share to decrypt

This commit is contained in:
Dominik Schürmann 2014-09-29 22:52:03 +02:00
parent 8e5c5c9503
commit 43140c10b1
2 changed files with 5 additions and 4 deletions

View File

@ -112,11 +112,11 @@ public class DecryptTextActivity extends ActionBarActivity {
} }
if (Intent.ACTION_SEND.equals(action) && type != null) { if (Intent.ACTION_SEND.equals(action) && type != null) {
// Android action Log.logDebugBundle(extras, "extras");
// When sending to Keychain Decrypt via share menu // When sending to Keychain Decrypt via share menu
if ("text/plain".equals(type)) { if ("text/plain".equals(type)) {
String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); String sharedText = extras.getString(Intent.EXTRA_TEXT);
sharedText = getPgpContent(sharedText); sharedText = getPgpContent(sharedText);
if (sharedText != null) { if (sharedText != null) {

View File

@ -302,7 +302,6 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv
// Handle intent actions // Handle intent actions
handleActions(getIntent()); handleActions(getIntent());
updateModeFragment(); updateModeFragment();
} }
@Override @Override
@ -359,9 +358,11 @@ public class EncryptTextActivity extends EncryptActivity implements EncryptActiv
// When sending to OpenKeychain Encrypt via share menu // When sending to OpenKeychain Encrypt via share menu
if (Intent.ACTION_SEND.equals(action) && type != null) { if (Intent.ACTION_SEND.equals(action) && type != null) {
Log.logDebugBundle(extras, "extras");
// When sending to OpenKeychain Encrypt via share menu // When sending to OpenKeychain Encrypt via share menu
if ("text/plain".equals(type)) { if ("text/plain".equals(type)) {
String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); String sharedText = extras.getString(Intent.EXTRA_TEXT);
if (sharedText != null) { if (sharedText != null) {
// handle like normal text encryption, override action and extras to later // handle like normal text encryption, override action and extras to later
// executeServiceMethod ACTION_ENCRYPT_TEXT in main actions // executeServiceMethod ACTION_ENCRYPT_TEXT in main actions