1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-09 08:21:30 -07:00

Android compatibility fixes

* doc/emacs/android.texi (Android Windowing): Document
restrictions on number of windows under Android 4.4 and earlier.

* java/AndroidManifest.xml.in <EmacsActivity>
<EmacsOpenActivity, EmacsMultitaskActivity>: Assign each class
of activity a unique task affinity.

* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Remove redundant priority assignment.

* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Handle
file URIs when processing attachments from a mailto URI, and
check for KitKat before opening content ones.

* java/org/gnu/emacs/EmacsWindow.java <pointerMap>
(figureChange): Replace coordinate HashMap with a SparseArray.

* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow): Don't specify FLAG_ACTIVITY_NEW_DOCUMENT on
systems where it is absent.
This commit is contained in:
Po Lu 2024-03-21 14:23:40 +08:00
parent 0df28dc00e
commit ad0492c5a9
6 changed files with 70 additions and 30 deletions

View file

@ -535,7 +535,9 @@ public final class EmacsOpenActivity extends Activity
uri = intent.getParcelableExtra (Intent.EXTRA_STREAM);
if ((scheme = uri.getScheme ()) != null
&& scheme.equals ("content"))
&& scheme.equals ("content")
&& (Build.VERSION.SDK_INT
>= Build.VERSION_CODES.KITKAT))
{
tem1 = EmacsService.buildContentName (uri, resolver);
attachmentString = ("'(\"" + (tem1.replace ("\\", "\\\\")
@ -543,6 +545,14 @@ public final class EmacsOpenActivity extends Activity
.replace ("$", "\\$"))
+ "\")");
}
else if (scheme != null && scheme.equals ("file"))
{
tem1 = uri.getPath ();
attachmentString = ("'(\"" + (tem1.replace ("\\", "\\\\")
.replace ("\"", "\\\"")
.replace ("$", "\\$"))
+ "\")");
}
}
else
{
@ -567,7 +577,9 @@ public final class EmacsOpenActivity extends Activity
if (uri != null
&& (scheme = uri.getScheme ()) != null
&& scheme.equals ("content"))
&& scheme.equals ("content")
&& (Build.VERSION.SDK_INT
>= Build.VERSION_CODES.KITKAT))
{
tem1
= EmacsService.buildContentName (uri, resolver);
@ -577,6 +589,16 @@ public final class EmacsOpenActivity extends Activity
.replace ("$", "\\$"));
builder.append ("\"");
}
else if (scheme != null
&& scheme.equals ("file"))
{
tem1 = uri.getPath ();
builder.append ("\"");
builder.append (tem1.replace ("\\", "\\\\")
.replace ("\"", "\\\"")
.replace ("$", "\\$"));
builder.append ("\"");
}
}
builder.append (")");
@ -604,7 +626,13 @@ public final class EmacsOpenActivity extends Activity
{
fileName = null;
if (scheme.equals ("content"))
if (scheme.equals ("content")
/* Retrieving the native file descriptor of a
ParcelFileDescriptor requires Honeycomb, 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)
{
/* This is one of the annoying Android ``content''
URIs. Most of the time, there is actually an