From 615a1fb7618de3b36c76689269add9147334900b Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 9 Aug 2024 10:11:47 +0800 Subject: [PATCH] Register for more Intents actions on Android * java/AndroidManifest.xml.in : Register for SEND Intents with mailto URIs. * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Use Intent constants rather than string literals. (cherry picked from commit 16462b1a62d04a726f99f275b37fd3e6fd512202) --- java/AndroidManifest.xml.in | 1 + java/org/gnu/emacs/EmacsOpenActivity.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in index f3bab2c1b76..df00e497f8f 100644 --- a/java/AndroidManifest.xml.in +++ b/java/AndroidManifest.xml.in @@ -270,6 +270,7 @@ along with GNU Emacs. If not, see . --> + diff --git a/java/org/gnu/emacs/EmacsOpenActivity.java b/java/org/gnu/emacs/EmacsOpenActivity.java index 28e1e261821..366283168dd 100644 --- a/java/org/gnu/emacs/EmacsOpenActivity.java +++ b/java/org/gnu/emacs/EmacsOpenActivity.java @@ -422,11 +422,11 @@ public final class EmacsOpenActivity extends Activity /* Now see if the action specified is supported by Emacs. */ - if (action.equals ("android.intent.action.VIEW") - || action.equals ("android.intent.action.EDIT") - || action.equals ("android.intent.action.PICK") - || action.equals ("android.intent.action.SEND") - || action.equals ("android.intent.action.SENDTO")) + if (action.equals (Intent.ACTION_VIEW) + || action.equals (Intent.ACTION_EDIT) + || action.equals (Intent.ACTION_PICK) + || action.equals (Intent.ACTION_SEND) + || action.equals (Intent.ACTION_SENDTO)) { /* Obtain the URI of the action. */ uri = intent.getData (); -- 2.39.2