mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-26 07:11:34 -08:00
Respect file display names during Android drag-and-drop
* java/org/gnu/emacs/EmacsService.java (buildContentName): Remove redundant projection argument to resolver.query. * java/org/gnu/emacs/EmacsWindow.java (onDragEvent): If a content resolver is available, attempt to convert content URIs into file names in advance. * lisp/term/android-win.el (android-handle-dnd-event): Adjust correspondingly.
This commit is contained in:
parent
014cd00402
commit
e72f17e462
3 changed files with 39 additions and 20 deletions
|
|
@ -31,6 +31,7 @@ import android.app.Activity;
|
|||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipDescription;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
|
||||
import android.graphics.Rect;
|
||||
|
|
@ -1699,10 +1700,11 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
ClipData data;
|
||||
ClipDescription description;
|
||||
int i, j, x, y, itemCount;
|
||||
String type;
|
||||
String type, uriString;
|
||||
Uri uri;
|
||||
EmacsActivity activity;
|
||||
StringBuilder builder;
|
||||
ContentResolver resolver;
|
||||
|
||||
x = (int) event.getX ();
|
||||
y = (int) event.getY ();
|
||||
|
|
@ -1799,6 +1801,20 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
{
|
||||
if ((activity.requestDragAndDropPermissions (event) == null))
|
||||
uri = null;
|
||||
else
|
||||
{
|
||||
resolver = activity.getContentResolver ();
|
||||
|
||||
/* Substitute a content file name for the URI, if
|
||||
possible. */
|
||||
uriString = EmacsService.buildContentName (uri, resolver);
|
||||
|
||||
if (uriString != null)
|
||||
{
|
||||
builder.append (uriString).append ("\n");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uri != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue