summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-11-14 10:57:18 +0800
committerPo Lu <luangruo@yahoo.com>2023-11-14 10:57:18 +0800
commitbda31b2c6d62652c742e800b692dffd926f8284b (patch)
treedcf38d61157be0062402c7c6aceea931899614e6 /java
parent1fe949888057b0275da041288709bd5690501974 (diff)
downloademacs-bda31b2c6d62652c742e800b692dffd926f8284b.tar.gz
Properly merge EXTRA_EMAIL content with mailto URIs
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): EXTRA_EMAIL is an array rather than a string, so insert its first element into an empty mailto URI.
Diffstat (limited to 'java')
-rw-r--r--java/org/gnu/emacs/EmacsOpenActivity.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/java/org/gnu/emacs/EmacsOpenActivity.java b/java/org/gnu/emacs/EmacsOpenActivity.java
index a5e8be2f238..5cca6cfcdff 100644
--- a/java/org/gnu/emacs/EmacsOpenActivity.java
+++ b/java/org/gnu/emacs/EmacsOpenActivity.java
@@ -414,6 +414,7 @@ public final class EmacsOpenActivity extends Activity
String subjectString, textString, attachmentString;
CharSequence tem;
String tem1;
+ String[] emails;
StringBuilder builder;
List<Parcelable> list;
@@ -466,16 +467,16 @@ public final class EmacsOpenActivity extends Activity
/* If fileName is merely mailto: (absent either an email
address or content), then the program launching Emacs
conceivably provided such an URI to exclude non-email
- programs from being enumerated within the Share dialog;
- whereupon Emacs should replace it with any address
- provided as EXTRA_EMAIL. */
+ programs from the Share dialog. Intents created thus
+ might hold the recipient email as a string array, which
+ is non-standard behavior. */
if (fileName.equals ("mailto:") || fileName.equals ("mailto://"))
{
- tem = intent.getCharSequenceExtra (Intent.EXTRA_EMAIL);
+ emails = intent.getStringArrayExtra (Intent.EXTRA_EMAIL);
- if (tem != null)
- fileName = "mailto:" + tem;
+ if (emails[0] != null && emails.length > 0)
+ fileName = "mailto:" + emails[0];
}
/* Subsequently, escape fileName such that it is rendered