Enable opening mailto URLs under Android

* doc/emacs/android.texi (Android Startup): Mention how mailto
URLs are treated by the emacsclient wrapper.

* java/AndroidManifest.xml.in: Register `mailto' scheme filters
for EmacsOpenActivity.

* java/org/gnu/emacs/EmacsOpenActivity.java (startEmacsClient):
Extract code that starts Emacs when it isn't already running,
and take a list of arguments rather than a single file name.
(onCreate): If the scheme is `mailto', escape the URI and call
`message-mailto'.
This commit is contained in:
Po Lu
2023-09-22 09:36:40 +08:00
parent 9db3fbd369
commit d71b9673a0
3 changed files with 73 additions and 23 deletions

View File

@@ -122,6 +122,21 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="org-protocol"/>
</intent-filter>
<!-- And also mailto links. -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="mailto"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SENDTO"/>
<data android:scheme="mailto"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name="org.gnu.emacs.EmacsMultitaskActivity"