aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2023-10-02 11:00:39 +0800
committerPo Lu2023-10-02 11:00:39 +0800
commitdb704687bb9992212cec0d5435f6dcd75161e229 (patch)
tree3cceef70e6a7813589822a871e954b958f7c0b25 /java
parent862e5effbf9b991af3fbbc8e31df33e64483c56f (diff)
downloademacs-db704687bb9992212cec0d5435f6dcd75161e229.tar.gz
emacs-db704687bb9992212cec0d5435f6dcd75161e229.zip
Update Android port
* java/AndroidManifest.xml.in: Exclude non-files from opening in Emacs. * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Avert crash should scheme be NULL.
Diffstat (limited to 'java')
-rw-r--r--java/AndroidManifest.xml.in5
-rw-r--r--java/org/gnu/emacs/EmacsOpenActivity.java6
2 files changed, 10 insertions, 1 deletions
diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in
index d4017a055dd..9ba9dabde81 100644
--- a/java/AndroidManifest.xml.in
+++ b/java/AndroidManifest.xml.in
@@ -110,7 +110,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
110 <action android:name="android.intent.action.EDIT"/> 110 <action android:name="android.intent.action.EDIT"/>
111 <action android:name="android.intent.action.PICK"/> 111 <action android:name="android.intent.action.PICK"/>
112 <category android:name="android.intent.category.DEFAULT"/> 112 <category android:name="android.intent.category.DEFAULT"/>
113 <data android:mimeType="*/*"/> 113 <!-- Don't offer to start Emacs for URLs that designate
114 resources other than files. -->
115 <data android:mimeType="*/*" android:scheme="file"/>
116 <data android:mimeType="*/*" android:scheme="content"/>
114 </intent-filter> 117 </intent-filter>
115 118
116 <!-- Facilitate opening org-protocol:// URLs as well, the same 119 <!-- Facilitate opening org-protocol:// URLs as well, the same
diff --git a/java/org/gnu/emacs/EmacsOpenActivity.java b/java/org/gnu/emacs/EmacsOpenActivity.java
index d27139e98bc..202b3c8c5dc 100644
--- a/java/org/gnu/emacs/EmacsOpenActivity.java
+++ b/java/org/gnu/emacs/EmacsOpenActivity.java
@@ -438,6 +438,12 @@ public final class EmacsOpenActivity extends Activity
438 438
439 scheme = uri.getScheme (); 439 scheme = uri.getScheme ();
440 440
441 /* It is possible for scheme to be NULL, under Android 2.3 at
442 least. */
443
444 if (scheme == null)
445 return;
446
441 /* If URL is a mailto URI, call `message-mailto' much the same 447 /* If URL is a mailto URI, call `message-mailto' much the same
442 way emacsclient-mail.desktop does. */ 448 way emacsclient-mail.desktop does. */
443 449