* java/org/gnu/emacs/EmacsApplication.java (EmacsApplication)
<apkFileName>: New field.
(getApkFile): Move from EmacsService.java.
(findDumpFile): If the dump file is older than the APK, delete
it irrespective of whether the checksums agree.
(onCreate): Initialize apkFileName.
* java/org/gnu/emacs/EmacsService.java (onCreate): Use
EmacsApplication.apkFileName.
* src/android.c (android_on_low_memory): Correct arguments to
Fclear_image_cache.
* src/image.c (Fclear_image_cache): Check that animation_cache
is always a cons.
* java/org/gnu/emacs/EmacsNative.java (onLowMemory):
* java/org/gnu/emacs/EmacsService.java (onLowMemory): New
function.
* src/android.c (android_on_low_memory, onLowMemory): New
functions called when a VM caution is registered. Clear
the image cache and run garbage collection.
* java/org/gnu/emacs/EmacsNative.java (shutDownEmacs):
* java/org/gnu/emacs/EmacsService.java (onDestroy): New
function. When invoked, call shut_down_emacs and await its
completion.
* src/android.c (android_shut_down_emacs, shutDownEmacs): New
functions.
* java/org/gnu/emacs/EmacsNative.java (close): New declaration.
* java/org/gnu/emacs/EmacsSdk11Clipboard.java
(getClipboardData): Catch SecurityException and guarantee file
descriptors are closed even if exceptions arise.
* src/android.c (dup): Export another function.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow)
<dndXPosition, dndYPosition>: New fields initialized to -1.
(onDragEvent): Remember the position of the previous event to
avoid sending duplicates.
* src/androidvfs.c (EMACS_PATH_MAX): New define.
(android_saf_tree_rename, android_saf_tree_opendir)
(android_name_file, android_fstatat, android_faccessat)
(android_fchmodat, android_readlinkat): Use EMACS_PATH_MAX where
SAF file names might be encountered.
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): If an
empty mailto: URI is supplied, ascertain if EXTRA_EMAIL is set,
then derive a mailto URI from that if so.
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Infer
e-mail body and subject from its parameters and convey this
information to message-mailto.
* lisp/gnus/message.el (message-mailto): New arguments SUBJECT,
BODY and FILE-ATTACHMENTS.
(message-mailto-1): Insert these arguments as appropriate.
* java/org/gnu/emacs/EmacsService.java (getUsefulContentResolver)
(getContentResolverContext): New functions which return a
content resolver from an EmacsActivity, if at all possible.
(openContentUri, checkContentUri): Probe or open URIs through
such content resolvers. Probe URIs by opening them if merely
testing permissions fails, for DND URIs do not make
checkCallingUriPermission return true.
* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Address
potential crash.
* src/androidvfs.c (android_check_content_access): Circumvent
JNI dynamic method dispatch.
(android_authority_name): Guarantee NAME is never a directory.
* java/org/gnu/emacs/EmacsNative.java (sendDndDrag, sendDndUri)
(sendDndText): Declare new event-sending functions.
* java/org/gnu/emacs/EmacsView.java (onDragEvent): New function.
* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): New
function; respond to each drag and drop event, request
permissions if necessary and transfer dropped data to Lisp.
* lisp/dnd.el (dnd-unescape-file-uris): New variable.
(dnd-get-local-file-name): If that variable is nil, refrain from
unescaping URLs provided.
* lisp/term/android-win.el (android-handle-dnd-event): New
function.
(special-event-map): Bind drag-n-drop-event.
* src/android.c (sendDndDrag, sendDndUri, sendDndText): New
functions.
* src/androidgui.h (enum android_event_type): New event types
ANDROID_DND_DRAG_EVENT, ANDROID_DND_URI_EVENT,
ANDROID_DND_TEXT_EVENT.
(struct android_dnd_event): New structure.
(union android_event) <dnd>: New field.
* src/androidterm.c (handle_one_android_event)
<ANDROID_DND_..._EVENT>: Generate drag-n-drop events for each
of these types.
(syms_of_androidterm) <Quri, Qtext>: New defsyms.
* java/org/gnu/emacs/EmacsActivity.java (invalidateFocus1):
Synchronize with window.children for iteration through it.
* java/org/gnu/emacs/EmacsService.java (queryTree): Synchronize
with windowList for iteration through it.
* java/org/gnu/emacs/EmacsView.java (moveChildToBack): Correct
formatting mistake.
(moveAbove, moveBelow): New functions.
* java/org/gnu/emacs/EmacsWindow.java (destroyHandle, reparentTo)
(raise, lower): Remedy synchronization blunders.
(reconfigure): New function.
* src/android.c (android_init_emacs_window): Link with
`reconfigure'.
(android_reconfigure_wm_window): New wrapper function.
* src/androidfns.c (android_frame_restack): New function.
(Fandroid_frame_restack): Properly implement this function and
expunge outdated comment.
* src/androidgui.h (enum android_stack_mode)
(enum android_window_changes): New enumerators.
* java/org/gnu/emacs/EmacsInputConnection.java (replaceText):
New function.
* java/org/gnu/emacs/EmacsNative.java (replaceText): Declare
native function.
* src/androidgui.h (enum android_ime_operation): New operation
ANDROID_IME_REPLACE_TEXT.
* src/androidterm.c (android_handle_ime_event): Decode text when
encountering an ANDROID_IME_REPLACE_TEXT operation. Return if
decoding overflowed rather than presenting Qnil to textconv
functions.
(replaceText): New JNI function.
* src/frame.h (enum text_conversion_operation): New operation
TEXTCONV_REPLACE_TEXT.
* src/textconv.c (really_commit_text): Move point to start if
the composing region is set.
(really_replace_text): New function.
(handle_pending_conversion_events_1) <TEXTCONV_REPLACE_TEXT>:
New case.
(replace_text): New function.
* src/textconv.h: Update prototypes.
* java/AndroidManifest.xml.in: Exclude non-files from opening in
Emacs.
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Avert
crash should scheme be NULL.
4776d90c31 Add new Tramp test
ca5b48fd76 Fix tmm-mid-prompt :type (Bug#66179)
7447d3df94 Fix tree-sitter indentation conflict with multiple languages
bee18e5273 Fix bug#66093 in Tramp
7d5fee0fea Support regeneration of ja-dic.el under '--with-small-ja-...
Conflicts:
make-dist
* doc/emacs/android.texi (Android Windowing): Document
`android-keyboard-bell-duration'.
* java/org/gnu/emacs/EmacsService.java (ringBell): New argument
DURATION.
* src/android.c (android_init_emacs_service): Adjust
correspondingly.
(android_bell): Provide the duration of the vibration.
* src/androidfns.c (syms_of_androidfns)
<android_keyboard_bell_duration>: New variable.
* doc/lispref/os.texi (Desktop Notifications): Revise
documentation for android-notifications-notify to reflect
changes.
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Convert notification importance to a legacy priority between
Android 7.1 and 4.1.
* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Remove
immutable bitmap constructor, as the underlying Android API
functions are erroneously implemented.
* src/android.c (android_init_emacs_pixmap): Cease searching for
deleted constructor.
(android_create_pixmap_from_bitmap_data): Create a pixmap, then
fill it with the contents of the bitmap, in lieu of employing
the aforementioned constructor.
* src/androidselect.c (Fandroid_notifications_notify): Revise
doc string.
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog): Wrap
CONTEXT within EmacsStyle such that dialogs are displayed in the
same style used by activities.
* 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'.
* java/org/gnu/emacs/EmacsDrawLine.java (perform):
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Call
damageRect with integer coordinates in lieu of consing a new
Rect.
* java/org/gnu/emacs/EmacsDrawable.java (damageRect) <IIII>:
Declare a new variant of damageRect, accepting four integers
designating the extents of the damage rectangle.
* java/org/gnu/emacs/EmacsPixmap.java (damageRect) <IIII>: New
stub.
* java/org/gnu/emacs/EmacsView.java (damageRect) <IIII>:
Implement this overloaded variant of damageRect.
* java/org/gnu/emacs/EmacsWindow.java (damageRect): Ditto.
* src/android.c (android_init_emacs_drawable)
(android_init_emacs_window): Move search for `damageRect' to
android_init_emacs_window.
(android_damage_window): Call IIII variant of `damageRect' to
avoid consing a new rectangle. Ameliorate dynamic method
dispatch overhead.
* java/org/gnu/emacs/EmacsContextMenu.java (display): Return
false if the list of menu buttons is empty, lest Android cease
displaying menus on the assumption that Emacs is defective.
* java/org/gnu/emacs/EmacsView.java (popupMenu): Likewise.
* src/fns.c (sort_list): Render sentence motion commands
functional within commentary
* src/sfntfont.c (sfntfont_list_family): Sort and deduplicate
the returned family list and make it a list of symbols.
(syms_of_sfntfont) <Qstring_lessp>: New defsym.
* java/org/gnu/emacs/EmacsFontDriver.java (FONT_INVALID_CODE):
New constant.
(hasChar, encodeChar): Accept a jint character code rather than
a jchar.
* java/org/gnu/emacs/EmacsSdk23FontDriver.java (hasChar)
(encodeChar): Return 0 or FONT_INVALID_CODE if the character is
not representable in a Java char.
* java/org/gnu/emacs/EmacsSdk7FontDriver.java (hasChar): Ditto.
* src/androidfont.c (android_init_font_driver): Adjust signature
to match.
* java/org/gnu/emacs/EmacsSdk7FontDriver.java (Sdk7Typeface):
Rename fileName to familyName and cease attempting to infer a
style from it.
(EmacsSdk7FontDriver): Employ preset typefaces rather than
enumerating each typeface within the system fonts directory.
(draw): Circumvent kerning difficulties by advancing past each
character individually.
* doc/emacs/android.texi (Android Environment): List two
additional permissions within the summary of permissions granted
by default.
* java/AndroidManifest.xml.in: Request READ_CALENDAR and
WRITE_CALENDAR.
* java/org/gnu/emacs/EmacsOpenActivity.java
(checkReadableOrCopy): If FILE is NULL, return a matching
content URI if possible, else generate a file name with the URI
as a reference.
(onCreate): Catch SecurityException around calls to
openFileDescriptor.
* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Make
dimensions final, since they are never changed after the
constructor.
* lib-src/emacsclient.c (decode_options): If --display is not
provided, always set display to `android' even if DISPLAY is
provided.
* lisp/net/browse-url.el (browse-url): Cease setting DISPLAY
under Android.
* src/callproc.c (getenv_internal, make_environment_block):
Don't afford DISPLAY special treatment under Android.
* admin/notes/java: New file. Move most of its contents from
README, and introduce a section on compatibility.
* java/README: Move internals to admin/notes/java.
* doc/emacs/android.texi (Android Startup): Revise to reflect
changes in the set of files registered for Emacsclient and
mention org-protocol support.
* java/AndroidManifest.xml.in: Open all files, not just a
particular subset of image and data files. Register an
org-protocol scheme handler.
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Provide
URI to Emacs verbatim if its scheme is `org-protocol'.
* doc/emacs/android.texi (Android Windowing): Mention C-SPC
interception and how it may be disabled.
* java/org/gnu/emacs/EmacsNative.java (shouldForwardCtrlSpace):
New function.
* java/org/gnu/emacs/EmacsView.java (onKeyPreIme): New function.
If the provided key code is SPC and the event's modifier key
mask contains ControlMask, relay it directly to onKeyDown.
* java/org/gnu/emacs/EmacsWindow.java (eventModifiers): Export
and make static.
* src/android.c (shouldForwardCtrlSpace): New function.
* src/androidfns.c (syms_of_androidfns)
<android_intercept_control_space>: New defvar.
* java/org/gnu/emacs/EmacsActivity.java (attachWindow, onDestroy)
(onWindowFocusChanged, onContextMenuClosed):
* java/org/gnu/emacs/EmacsContextMenu.java (onMenuItemClick):
* java/org/gnu/emacs/EmacsDialog.java (onClick, display1, onDismiss):
* java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy)
(onDestroy, onWindowFocusChanged, onPause):
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow, removeWindowConsumer, detachWindow)
(noticeIconified, noticeDeiconified): Remove superfluous
debugging code now that the Android port is stable.
* java/org/gnu/emacs/EmacsView.java (onLayout): Detect if the
IME is hidden while a toplevel window is focused, and clear
isCurrentlyTextEditor in that case.
(onApplyWindowInsets): New function.
(raise, lower, popupMenu, onCreateInputConnection): Delete
aforementioned debugging code.
* doc/emacs/android.texi (Android Environment): Mention the
`rcs2log' program name variable. Also refine the wording of the
paragraph describing bundled programs a bit.
* doc/lispref/processes.texi (Subprocess Creation): Mention
`rcs2log' and `rcs2log-program-name'. Correct typos and
spelling mistakes within the variable index.
* etc/NEWS: Amend the announcement of *-program-name to also
cite rcs2log.
* java/Makefile.in (install_temp): Copy rcs2log to
lib/*/librcs2log.so after minor revisions to change the
interpreter name.
* lisp/vc/vc-rcs.el (vc-rcs-rcs2log-program): Ground the program
name upon `rcs2log-program-name'.
* src/callproc.c (syms_of_callproc) <Vrcs2log_program_name>: New
defvar. Define to `librcs2log.so' under Android, `rcs2log'
elsewhere.
* java/org/gnu/emacs/EmacsSdk11Clipboard.java (getClipboardData):
Return null if the clip data is not set. Also delete superfluous
debugging code. (bug#65445)
(getClipboard): Don't dereference NULL clip data.
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Provide FLAG_IMMUTABLE under Android S and later, not just
versions of Android after S. (bug#65433)
* java/AndroidManifest.xml.in (EmacsApplication): Set icon to
@mipmap/emacs_icon.
* java/org/gnu/emacs/EmacsService.java (onStartCommand): Pick a
better name for the persistent notification channel.
* java/res/drawable/emacs_background.xml:
* java/res/drawable/emacs_foreground.xml:
* java/res/mipmap/emacs_icon.png:
* java/res/mipmap-v26/emacs_icon.xml: New files, comprising an
``adaptive icon'' required by some Android launchers.
* doc/lispref/os.texi (Desktop Notifications)
<android-notifications-notify>: Mention the :icon parameter.
* java/org/gnu/emacs/EmacsDesktopNotification.java
(EmacsDesktopNotification) <icon>: New field.
(<init>): New argument ICON. Set this.icon to its value.
(display1): Use provided icon and always supply a pending intent
to open Emacs once the notification is clicked.
* java/res/layout/sdk8_notifications_view.xml
(sdk8_notifications_title, sdk8_notifications_content): Set
foreground color to #000000.
* src/androidselect.c (android_init_emacs_desktop_notification):
Update signature of <init>.
(android_locate_icon): New function.
(android_notifications_notify_1): New arg ICON.
(Fandroid_notifications_notify): New parameter icon.
(syms_of_androidselect): <QCicon>: New symbol.
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Create a pending intent and set it as the contentIntent when
building a notification by hand.
* doc/emacs/android.texi (Android Environment): Correct list of
permissions granted by default.
* doc/lispref/os.texi (Desktop Notifications): Document the new
function `android-notifications-notify' and its limitations.
* java/AndroidManifest.xml.in: Request notification permissions.
* java/org/gnu/emacs/EmacsDesktopNotification.java: New file.
* java/res/layout/sdk8_notifications_view.xml: New file holding
substitute notification widget definitions for Android versions
prior to 3.0.
* java/res/values/strings.xml: Remove inadvertently introduced
tag attribute.
* lisp/org/org-clock.el (haiku-notifications-notify): Correct
file name in function declaration.
(android-notifications-notify): New declaration.
(org-show-notification): Use `android-notifications-notify'.
* src/androidselect.c (android_init_emacs_desktop_notification)
(android_notifications_notify_1, Fandroid_notifications_notify):
New functions.
(init_androidselect, syms_of_androidselect): Initialize new
class and define new subr.
* java/org/gnu/emacs/EmacsService.java (checkContentUri): Take a
string instead of a byte array. Then, use
checkCallingUriPermission, in lieu of opening the file.
* src/android.c (android_check_content_access): Delete unused
function.
(android_init_emacs_service): Adjust for changes to
checkContentUri's signature.
* src/androidvfs.c (android_get_content_name): Return the file
name in a new buffer.
(android_check_content_access): Adjust correspondingly.
(android_authority_name): Verify NAME is a valid JNI string.