summaryrefslogtreecommitdiff
path: root/java/org/gnu/emacs/EmacsOpenActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/org/gnu/emacs/EmacsOpenActivity.java')
-rw-r--r--java/org/gnu/emacs/EmacsOpenActivity.java39
1 files changed, 17 insertions, 22 deletions
diff --git a/java/org/gnu/emacs/EmacsOpenActivity.java b/java/org/gnu/emacs/EmacsOpenActivity.java
index 327a53bc417..cdc68aea2bf 100644
--- a/java/org/gnu/emacs/EmacsOpenActivity.java
+++ b/java/org/gnu/emacs/EmacsOpenActivity.java
@@ -19,29 +19,23 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
package org.gnu.emacs;
-/* This class makes the Emacs server work reasonably on Android.
+/* Opening external documents on Android.
- There is no way to make the Unix socket publicly available on
- Android.
+ This activity is registered as an application capable of opening text
+ files and files in several other formats that Emacs understands, and
+ assumes responsibility for deriving file names from the files
+ provided to `onCreate', potentially copying them to temporary
+ directories in the process, and invoking `emacsclient' with suitable
+ arguments to open the same. In this respect, it fills the role of
+ `etc/emacs.desktop' on XDG systems.
- Instead, this activity tries to connect to the Emacs server, to
- make it open files the system asks Emacs to open, and to emulate
- some reasonable behavior when Emacs has not yet started.
+ It is also registered as a handler for mailto URIs, in which capacity
+ it constructs invocations of `emacsclient' so as to start
+ `message-mailto' with their contents and attachments, much like
+ `etc/emacs-mail.desktop'.
- First, Emacs registers itself as an application that can open text
- and image files.
-
- Then, when the user is asked to open a file and selects ``Emacs''
- as the application that will open the file, the system pops up a
- window, this activity, and calls the `onCreate' function.
-
- `onCreate' then tries very to find the file name of the file that
- was selected, and give it to emacsclient.
-
- If emacsclient successfully opens the file, then this activity
- starts EmacsActivity (to bring it on to the screen); otherwise, it
- displays the output of emacsclient or any error message that occurs
- and exits. */
+ As with all other activities, it is registered in the package
+ manifest file. */
import android.app.AlertDialog;
import android.app.Activity;
@@ -628,11 +622,12 @@ public final class EmacsOpenActivity extends Activity
if (scheme.equals ("content")
/* Retrieving the native file descriptor of a
- ParcelFileDescriptor requires Honeycomb, and
+ ParcelFileDescriptor requires Honeycomb MR1, and
proceeding without this capability is pointless on
systems before KitKat, since Emacs doesn't support
opening content files on those. */
- && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
+ && (Build.VERSION.SDK_INT
+ >= Build.VERSION_CODES.HONEYCOMB_MR1))
{
/* This is one of the annoying Android ``content''
URIs. Most of the time, there is actually an