emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-30 16462b1a62d: Register for more Intents actions on Android


From: Po Lu
Subject: emacs-30 16462b1a62d: Register for more Intents actions on Android
Date: Thu, 8 Aug 2024 22:12:08 -0400 (EDT)

branch: emacs-30
commit 16462b1a62d04a726f99f275b37fd3e6fd512202
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Register for more Intents actions on Android
    
    * java/AndroidManifest.xml.in <EmacsOpenActivity>: Register
    for SEND Intents with mailto URIs.
    
    * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Use
    Intent constants rather than string literals.
---
 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 
<https://www.gnu.org/licenses/>. -->
       </intent-filter>
 
       <intent-filter>
+        <action android:name="android.intent.action.SEND"/>
         <action android:name="android.intent.action.SENDTO"/>
         <data android:scheme="mailto"/>
         <category android:name="android.intent.category.DEFAULT"/>
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 ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]