Commit graph

316 commits

Author SHA1 Message Date
Po Lu
ee2e0031d8 ; Delete obsolete commentary
* java/org/gnu/emacs/EmacsDrawLine.java (perform): Delete
obsolete commentary.
2024-04-29 09:21:02 +08:00
Po Lu
e658a6938e Implement dots and dashes on Android
* java/org/gnu/emacs/EmacsDrawLine.java (EmacsDrawLine)
(measureLine, polyDashPattern): New function.
(perform): Delegate to polyDashPattern if the line style is not
LineSolid.  Also simplify now that anti-aliasing need no longer
be taken into account.

* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Mention
omission in commentary.

* java/org/gnu/emacs/EmacsGC.java (EmacsGC): Disable
anti-aliasing in default paint object.
<line_style, line>: New fields.
(markDirty): Apply stroke width.

* src/android.c (android_init_emacs_gc_class): Initialize new
fields.
(android_create_gc, android_free_gc, android_change_gc)
(android_set_dashes, android_get_gc_values):

* src/androidgui.h (enum android_line_style)
(enum android_gc_value_mask, struct android_gc): Introduce line
style, width, dash offset and dash GC attributes.

* src/androidterm.c (android_draw_dash, android_fill_underline)
(android_draw_glyph_string): Port from X.

* src/xterm.c (x_draw_dash): Delete redundant code.
2024-04-28 17:00:43 +08:00
Po Lu
db8f7ed7f6 Enable customization of the quit key on Android
* doc/emacs/android.texi (Android Windowing):

* doc/emacs/input.texi (On-Screen Keyboards): Document various
tidbits related to the quit key.

* java/org/gnu/emacs/EmacsNative.java (getQuitKeycode): New
function.

* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): Rename
`lastVolumeButtonRelease' to `lastQuitKeyRelease'.
(onKeyUp): Treat value returned by getQuitKeycode as the quit
key rather than mandate KEYCODE_VOLUME_DOWN.

* src/android.c (getQuitKeycode): Implement new function.

* src/androidterm.c (syms_of_androidterm)
<android_quit_keycode>: New variable.
2024-04-27 10:47:12 +08:00
Po Lu
cd56e85c08 ; Fix default Android tile mode
* java/org/gnu/emacs/EmacsGC.java (markDirty): Use rather REPEAT
than MIRROR.
2024-04-23 17:09:50 +08:00
Po Lu
b9c191d690 Implement face stipples on Android
* .gitignore:

* java/Makefile.in: Fix typos.

* java/org/gnu/emacs/EmacsFillRectangle.java (perform): Call
blitOpaqueStipple if filling an unobscured rectangle with an
opaque stipple.

* java/org/gnu/emacs/EmacsGC.java (EmacsGC) <tileObject>: New
field.
(markDirty): Synchronize the current stipple with tileObject.
(prepareStipple, blitOpaqueStipple): New functions.

* java/org/gnu/emacs/EmacsService.java (EmacsService)
<resources>: New static field.
(onCreate): Set it.

* src/android.c (android_create_bitmap_from_data): Correct order
of arguments to android_create_pixmap_from_bitmap_data.
(HAS_BUILTIN_TRAP): Delete macro.
(emacs_abort): Always induce backtraces by means of a NULL
pointer deference.

* src/dispextern.h (Emacs_GC, Emacs_Rectangle, GCForeground)
(GCBackground, GCFillStyle, GCStipple, FillOpaqueStipple)
[HAVE_ANDROID]: Define to their Android counterparts rather
than simulating their existence.

* src/epaths.in: Set bitmap path to /assets/bitmaps on Android.

* src/image.c (image_bitmap_pixmap): Also enable when
HAVE_ANDROID.

* src/sfntfont-android.c (sfntfont_android_put_glyphs): Assert
that this is never called to draw a stippled background.
* src/xfaces.c (x_create_gc) [HAVE_ANDROID]: Redefine as
wrapper around android_create_gc.
(prepare_face_for_display) [HAVE_ANDROID]: Enable stipples.
2024-04-23 14:30:38 +08:00
Po Lu
3bcdf010a9 Generate Android shared library list automatically
* .gitignore: Ignore new generated files.

* cross/Makefile.in (src/Makefile): Remove leftover
specification of the source Gnulib directory.

* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_READELF): New
variable.

* java/Makefile.in (CONFIG_FILE, ALL_DEPENDENCIES, READELF)
(cf-stamp-1, cf-stamp): New variables and rules; compute the set
of library files in the order of loading and generate a file
with this information.
(ALL_CLASS_FILES): New variable; if builddir is not srcdir,
$($(CONFIG_FILE), $(CLASS_FILES)): Depend on EmacsConfig.java.
add generated files in the build directory.
(classes.dex): Adjust to match.

* java/org/gnu/emacs/EmacsNative.java (EmacsNative)
<static initializer>: Load shared libraries from
EMACS_SHARED_LIBRARIES rather than a hard-coded list.

* m4/ndk-build.m4 (ndk_INIT): Search for readelf...
(ndk_CHECK_MODULES): ...and substitute its path as
NDK_BUILD_READELF.
2024-04-22 16:30:15 +08:00
Po Lu
7d6f4d9085 Fix load order of certain Android shared libraries
* java/org/gnu/emacs/EmacsNative.java (libraryDeps): Move
dependencies of selinux and gnutls before their respective
dependents.
2024-04-22 13:32:34 +08:00
Po Lu
571fd42d48 Eliminate minor wart in EmacsService.java
* java/org/gnu/emacs/EmacsService.java (openContentUri): Replace
arg BYTES with URI and change its type to String.

* src/android.c (android_init_emacs_service):

* src/androidvfs.c (android_authority_name)
(android_authority_open): Adjust commentary and code to match.
2024-04-20 20:46:17 +08:00
Po Lu
c19b988c29 Correctly verify availability of Android content URIs
* java/org/gnu/emacs/EmacsService.java (checkContentUri): Call
checkUriPermission with IPC-effective PID and UID rather than
checkCallingUriPermission, which never considers permissions of
Emacs itself, and delete the now-redundant workaround.
2024-04-18 10:38:22 +08:00
Po Lu
2823eae0b7 Remove leftover tasks from previous Emacs sessions on startup
* java/org/gnu/emacs/EmacsService.java (onCreate): Call
removeOldTasks.

* java/org/gnu/emacs/EmacsWindowManager.java (removeOldTasks):
New function.

* java/proguard.conf: Optimize optimizer configuration.
2024-04-14 10:36:50 +08:00
Po Lu
4fc3771078 Fix task-switching failures on Android 2.3
* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow):
Don't specify F_A_MULTIPLE_TASK on Android 4.4 and earlier.
2024-04-13 11:28:48 +08:00
Po Lu
b9acfd7c2b Optimize R8 configuration
* java/org/gnu/emacs/EmacsWindowManager.java (WindowConsumer):
Mark as package-local.

* java/proguard.conf: List only symbols that must be preserved,
enabling R8 to optimize the remainder.
2024-04-11 10:15:25 +08:00
Po Lu
7720c614af Adjust priority of Emacs background service notification
* java/org/gnu/emacs/EmacsService.java (onStartCommand): Reword
lightly and set importance to IMPORTANCE_LOW.
2024-04-11 09:16:57 +08:00
Po Lu
8ee1dc8f1f Resolve disagreements in accounting of tooltip positions on Android
* java/org/gnu/emacs/EmacsService.java (getLocationInWindow):
New function.

* java/org/gnu/emacs/EmacsWindow.java (translateCoordinates):
Derive "root window" position from the origin point of the
containing activity's window rather than that of the screen,
the two of which differ when "freeform mode" is enabled.
2024-04-07 14:51:29 +08:00
Po Lu
ae296d762b Port new Android window management strategy to Android 5.0
* doc/emacs/android.texi (Android Windowing): Revise to match.

* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow)
(removeWindowConsumer, pruneWindows): Decrease minimum API for
monitoring of tasks to Android 5.0.
(getTaskToken): Ignore misleading documentation and access
baseIntent by way of RecentTaskInfo.
2024-04-07 12:15:39 +08:00
Po Lu
617bd85cd0 Correct typos in and omissions from earlier Android port changes
* java/AndroidManifest.xml.in: Remove duplicate permissions.

* java/org/gnu/emacs/EmacsWindowManager.java
(removeWindowConsumer): Disregard isFinishing for non-initial
activities.
2024-04-06 11:17:49 +08:00
Po Lu
aad63f935f Enable relinquishing access to Android content directories
* doc/emacs/android.texi (Android Document Providers): Document
new command.

* java/org/gnu/emacs/EmacsService.java (relinquishUriRights):
New function.

* src/Makefile.in (SOME_MACHINE_OBJECTS): Add androidvfs.c.

* src/android.c (android_init_emacs_service): Link to new
function.

* src/android.h (struct android_emacs_service)
<relinquish_uri_rights>: New field.

* src/androidfns.c:

* src/androidvfs.c (android_saf_tree_name)
(android_saf_tree_opendir): Minor adjustments to commentary.
(Fandroid_relinquish_directory_access): New function.
(syms_of_androidvfs): Define new subr.
2024-04-05 15:04:09 +08:00
Po Lu
42c0603c7a Avoid destroying windows after they are unmapped
* java/org/gnu/emacs/EmacsActivity.java (destroy): Detach from
current window before calling finish.

* java/org/gnu/emacs/EmacsWindow.java (reparentTo): Don't clear
attachment state here...

* java/org/gnu/emacs/EmacsWindowManager.java (detachWindow):
...but do so here instead.
2024-04-04 09:53:07 +08:00
Po Lu
48dc75f235 ; * java/org/gnu/emacs/EmacsView.java (onKeyDown): Delete debugging code. 2024-04-03 20:43:42 +08:00
Po Lu
1f5a2c75e6 Prevent detachWindow from deleting frames
* java/org/gnu/emacs/EmacsWindowManager.java (detachWindow):
Remove WINDOW from the window list prior to pruning.
2024-04-03 20:41:08 +08:00
Po Lu
a0da5d04ba ; * java/org/gnu/emacs/EmacsWindow.java (reparentTo): Typo. 2024-04-03 20:33:58 +08:00
Po Lu
7df66b4762 Better align Emacs window management with Android task lifecycles
* java/org/gnu/emacs/EmacsActivity.java (onCreate): Permit
overriding by child classes.
(onDestroy): Minor stylistic adjustments.
(getAttachmentToken): New function.

* java/org/gnu/emacs/EmacsMultitaskActivity.java (onCreate)
(getAttachmentToken): New functions.

* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow):
<attachmentToken, preserve, previouslyAttached>: New variables.
(onActivityDetached): Remove redundant isFinishing argument.
(reparentTo): Reset the foregoing fields before registering with
the window manager.

* java/org/gnu/emacs/EmacsWindowManager.java
(EmacsWindowManager): Rename from EmacsWindowAttachmentManager.
(WindowConsumer): New function getAttachmentToken.
(isWindowEligible): New function.
(registerWindowConsumer, registerWindow, removeWindowConsumer)
(detachWindow): Implement a new window management strategy on
API 29 and subsequent releases where both varieties of toplevel
window are permanently, except when reparented, bound to the
activities to which they attach, and Emacs establishes at
strategic junctures whether those activities remain present.
(getTaskToken, pruneWindows): New functions.
2024-04-03 20:31:22 +08:00
Mattias Engdegård
1135ce461d Always enable native JSON support and remove Jansson references
* src/json.c (Fjson__available_p): Remove.
* lisp/subr.el (json-available-p): Always return t.
* admin/nt/dist-build/build-dep-zips.py:
* configure.ac:
* doc/lispref/text.texi (Parsing JSON):
* java/INSTALL:
* java/org/gnu/emacs/EmacsNative.java (EmacsNative):
* lisp/term/w32-win.el (dynamic-library-alist):
* m4/ndk-build.m4 (ndk_INIT):
* msdos/sed1v2.inp:
* nt/INSTALL:
* nt/INSTALL.W64:
* src/Makefile.in:
* src/emacs.c (main):
* src/lisp.h:
Remove JSON configuration options and references to it and Jansson from
documentation and build files.
* etc/NEWS: Announce.
2024-03-30 15:19:56 +01:00
Po Lu
c3684b9788 ; * java/org/gnu/emacs/EmacsActivity.java (isReallyFinishing): Fix typo. 2024-03-29 08:26:48 +08:00
Po Lu
755665d95a Prevent Android OS task trimming from deleting Emacs frames
* doc/emacs/android.texi (Android Windowing): Document proviso
on Android 7.0 and later.

* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity)
<timeOfLastInteraction>: New field.
(onStop, onResume): Set and clear timeOfLastInteraction.
(isReallyFinishing): New function.
(onDestroy): Don't delete frame even in the event isFinishing
returns true if more than 4 hours have elapsed since the
activity last moved into the background.
2024-03-29 08:26:48 +08:00
Po Lu
5a7c46355b Remove IME_FLAG_FORCE_ASCII from password input IME flags
* java/org/gnu/emacs/EmacsView.java (onCreateInputConnection):
Passwords might also be non-ASCII, and this flag apparently
requests an IME limited to ASCII characters, rather than just
capable of ASCII input.
2024-03-27 10:03:15 +08:00
Po Lu
b7b9a0a5c1 Prevent focus "stalemates" on Android
* java/org/gnu/emacs/EmacsActivity.java (invalidateFocus1): New
argument resetWhenChildless.
(invalidateFocus): If a toplevel window has no focus window,
transfer focus to the toplevel itself.
2024-03-26 10:54:39 +08:00
Po Lu
728bf2c9e5 Prevent passwords from being recorded during text conversion
* doc/lispref/commands.texi (Misc Events): Document new value of
text-conversion-style.

* java/org/gnu/emacs/EmacsService.java (EmacsService)
<IC_MODE_PASSWORD>: New constant.

* java/org/gnu/emacs/EmacsView.java (onCreateInputConnection):
Set TYPE_TEXT_VARIATION_PASSWORD and IME_FLAG_FORCE_ASII if mode
is IC_MODE_PASSWORD.

* lisp/subr.el (read-passwd): Set text-conversion-style to
`password'.

* src/androidgui.h (enum android_ic_mode): New value
ANDROID_IC_MODE_PASSWORD.

* src/androidterm.c (android_reset_conversion): Handle
`password'.

* src/buffer.c (syms_of_buffer)
<&BVAR (current_buffer, text_conversion_style)>: Update doc
string.

* src/textconv.c (syms_of_textconv) <Qpassword>: New DEFSYM.
<Vtext_conversion_edits>: Fix typos in doc string.
2024-03-26 10:11:26 +08:00
Po Lu
ba96c4ec56 Port restart-emacs to Android 4.3 and earlier
* java/org/gnu/emacs/EmacsService.java (restartEmacs): Run Emacs
from an alarm if required.
2024-03-25 15:42:23 +08:00
Po Lu
2be41da38e Improve consistency of content file name handling
* java/org/gnu/emacs/EmacsService.java (getDisplayNameHash):
Always encode file names as modified UTF-8, as insurance against
future changes to undocumented behavior of the JVM.
2024-03-24 11:00:47 +08:00
Po Lu
ad0492c5a9 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.
2024-03-21 14:23:40 +08:00
Po Lu
e72f17e462 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.
2024-03-20 10:23:42 +08:00
Po Lu
f2e239c6a7 Respect display names of Android content URIs
* java/org/gnu/emacs/EmacsNative.java (displayNameHash): New
function.

* java/org/gnu/emacs/EmacsService.java (buildContentName): New
argument RESOLVER.  Generate names holding URI's display name if
available.  All callers changed.

* lisp/international/mule-cmds.el (set-default-coding-systems):
Fix file name coding system as utf-8-unix on Android as on Mac
OS.

* src/androidvfs.c (enum android_vnode_type): New enum
ANDROID_VNODE_CONTENT_AUTHORITY_NAMED.
(android_content_name): Register root directories for this new
type.
(displayNameHash): New function.
(android_get_content_name): New argument WITH_CHECKSUM.  If
present, treat the final two components as a pair of checksum
and display name, and verify and exclude the two.
(android_authority_name): Provide new argument as appropriate.
(android_authority_initial_name): New function.
2024-03-19 12:08:17 +08:00
Po Lu
7a0f4de3c1 Improve C++ standard library detection on Android
* configure.ac: Stop relaying --with-ndk-cxx-shared to the
nested invocation of configure.

* build-aux/ndk-build-helper-1.mk (SYSTEM_LIBRARIES):

* build-aux/ndk-build-helper-2.mk (SYSTEM_LIBRARIES): Insert all
of the C++ libraries available on Android.

* configure.ac: Call ndk_LATE and ndk_LATE_EARLY within if
statement at toplevel, averting needless calls to AC_PROG_CXX.

* cross/ndk-build/Makefile.in (NDK_BUILD_CXX_STL)
(NDK_BUILD_CXX_LDFLAGS):

* cross/ndk-build/ndk-build.mk.in (NDK_BUILD_CXX_STL)
(NDK_BUILD_CXX_LDFLAGS): New variables.

* cross/ndk-build/ndk-resolve.mk (NDK_SYSTEM_LIBRARIES):
Introduce several other C++ libraries sometimes present on
Android.
(NDK_SO_EXTRA_FLAGS_$(LOCAL_MODULE)): Insert NDK_BUILD_CXX_STL
when any of these new C++ libraries are requested.

* m4/ndk-build.m4: Completely rewrite C++ compiler and library
detection.

* java/org/gnu/emacs/EmacsNative.java (EmacsNative): Attempt to
load more libraries from static initializer.

* java/INSTALL: Remove obsolete information.
2024-03-17 19:34:09 +08:00
Po Lu
db5c8bda63 ; * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Another fix. 2024-03-14 08:24:42 +08:00
Po Lu
e7e285ec34 Fix crash when displaying notifications on Android 3.0
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Don't call setPriority until Jelly Bean.
2024-03-13 15:35:40 +08:00
Po Lu
6b40d557c4 Port more notification senders to non-XDG systems
* doc/lispref/os.texi (Desktop Notifications): Document that
`:timeout' is now implemented.

* java/org/gnu/emacs/EmacsDesktopNotification.java
(EmacsDesktopNotification): New field delay.
(display1): Set delay on Android 8.0 and up.

* lisp/erc/erc-desktop-notifications.el
(erc-notifications-notify): Call Android or Haiku notification
functions on those systems.

* lisp/gnus/gnus-notifications.el (gnus-notifications-action)
(gnus-notification-close): Remove dismissed notifications from
the notification to message map.
(gnus-notifications-notify): Call android-notifications-notify
if possible.

* src/androidselect.c (android_init_emacs_desktop_notification):
Update accordingly.
(android_notifications_notify_1): New argument TIMEOUT.
(Fandroid_notifications_notify): New argument QCtimeout.
(syms_of_androidselect) <QCtimeout>: New symbol.
2024-03-13 11:01:39 +08:00
Po Lu
d7ded99608 Implement notification residency on Android
* doc/lispref/os.texi (Desktop Notifications): Document support
for `:resident'.

* java/org/gnu/emacs/EmacsService.java (cancelNotification):

* src/android.c (android_init_emacs_service):

* src/android.h (struct android_emacs_service): New function.

* src/androidselect.c (android_notifications_notify_1)
(Fandroid_notifications_notify): New parameter QCresident; save
it within notification lists.
(android_notification_deleted, android_notification_action):
Adjust for changes to the format of notification lists and
cancel non-resident notifications when an action is selected.
(syms_of_androidselect): <QCresident>: New symbol.
2024-03-12 09:48:53 +08:00
Po Lu
bf38783c32 Fix notification cancellation detection on Android
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1):
Don't specify FLAG_ONE_SHOT in cancel intents.
2024-03-12 08:51:52 +08:00
Po Lu
a7a37341ca Implement notification callbacks on Android
* doc/lispref/os.texi (Desktop Notifications): Document that
:on-cancel, :on-action and :actions are now supported on
Android.

* java/org/gnu/emacs/EmacsActivity.java (onNewIntent): New
function.

* java/org/gnu/emacs/EmacsDesktopNotification.java
(NOTIFICATION_ACTION, NOTIFICATION_TAG, NOTIFICATION_DISMISSED):
New constants.  <actions, titles>: New fields.
(insertActions): New function.
(display1, display): Insert actions on Jelly Bean and up, and
arrange to be notified when the notification is dismissed.
(CancellationReceiver): New class.

* java/org/gnu/emacs/EmacsNative.java (sendNotificationDeleted)
(sendNotificationAction): New functions.

* src/android.c (sendDndDrag, sendDndUri, sendDndText): Correct
return types.
(sendNotificationDeleted, sendNotificationAction)
(android_exception_check_5, android_exception_check_6): New
functions.

* src/android.h:

* src/androidgui.h (struct android_notification_event): New
structure.
(union android_event): New member for notification events.

* src/androidselect.c (android_init_emacs_desktop_notification):
Update JNI signatures.
(android_notifications_notify_1, Fandroid_notifications_notify):
New arguments ACTIONS, ACTION_CB and CANCEL_CB.  Convert and
record them as appropriate.
(android_notification_deleted, android_notification_action): New
functions.
(syms_of_androidselect): Prepare a hash table of outstanding
notifications.
<QCactions, QCon_action, QCon_cancel> New defsyms.

* src/androidterm.c (handle_one_android_event)
<ANDROID_NOTIFICATION_DELETED>
<ANDROID_NOTIFICATION_ACTION>: Dispatch event contents to
androidselect.c for processing.

* src/androidterm.h:

* src/androidvfs.c (java_string_class): Export.

* src/keyboard.c (kbd_buffer_get_event) <NOTIFICATION_EVENT>:
Call callback specified by the event.

* src/termhooks.h (enum event_kind) [HAVE_ANDROID]: New
enum NOTIFICATION_EVENT.
2024-03-11 21:41:14 +08:00
Po Lu
18b6289adf ; * java/org/gnu/emacs/EmacsPreferencesActivity.java: Fix commentary. 2024-03-10 10:37:14 +08:00
Po Lu
8d5983aa78 Fix bug#69321
* java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp):
Provide Right Alt (Alt Gr) masks to system keymap routines.
(bug#69321)
2024-02-24 10:01:57 +08:00
Po Lu
0a4d4781dd * java/org/gnu/emacs/EmacsContextMenu.java (display): Reduce timeout. 2024-02-21 21:55:48 +08:00
Po Lu
7b0d750188 Work around premature dismissals of submenus under Android
* java/org/gnu/emacs/EmacsContextMenu.java (display): If between
HONEYCOMB and N, set wasSubmenuSelected.
2024-02-21 11:49:47 +08:00
Po Lu
c2d714886e Implement tooltip_reuse_hidden_frame for Android
* java/org/gnu/emacs/EmacsWindow.java
(findSuitableActivityContext): Return Activity rather than
Context.
(mapWindow): Provide window token manually.

* src/androidfns.c (Fx_show_tip, Fx_hide_tip): Respect
tooltip_reuse_hidden_frame.
2024-02-18 12:48:41 +08:00
Eli Zaretskii
22d500ce21 Merge from origin/emacs-29
7d3a144486 ; Mention defface's and their :version tags in CONTRIBUTE.
09c53b717d * admin/notes/kind-communication: New file.
31ca4e5501 ; And another fix of CONTRIBUTE.
d65499e790 ; Another clarification in CONTRIBUTE.
571ec583d6 ; Clarify "ChangeLog entries" in CONTRIBUTE.
e268231686 Don't skip links to "." and ".." in Dired when marking files
e25d11314d Pass unquoted filename to user-supplied MUSTMATCH predicate
4749699370 * doc/lispref/parsing.texi (Retrieving Nodes): Improve do...
d0673ea0d4 ; * etc/PROBLEMS: Workaround for Windows key "stuck" (bug...

* lisp/emacs-lisp/trace.el:
* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Remove
training whitespace.
2024-02-10 05:07:56 -05:00
Po Lu
e7d1b12878 Make miscellaneous improvements to the Android port
* java/org/gnu/emacs/EmacsActivity.java (onCreate): Deal with
omitted calls to onWindowFocusChanged after activity recreation.

* java/org/gnu/emacs/EmacsService.java (clearWindow, clearArea):
Delete redundant wrapper functions.
(getUsefulContentResolver, getContentResolverContext): Delete
functions.
(openContentUri, checkContentUri): Stop searching for an
activity content resolver, as that's actually not necessary.

* src/android.c (android_init_emacs_service)
(android_init_emacs_window, android_clear_window)
(android_clear_area): Adjust to match.
2024-02-10 15:06:01 +08:00
Po Lu
e5cb268b2c Fix DEBUG_THREADS in the Android port
* java/org/gnu/emacs/EmacsService.java (EmacsService): New field
`mainThread'.
(onCreate): Set `mainThread' to the thread where the service's
looper executes.
(checkEmacsThread): Compare against SERVICE.mainThread.
2024-02-07 21:09:34 +08:00
Po Lu
0d2b712078 Don't forcibly display dialogs on Android if a keyboard is present
* java/org/gnu/emacs/EmacsService.java (detectKeyboard): New
function.

* lisp/subr.el (use-dialog-box-p): Don't always return t if a
keyboard is present on Android.

* src/android.c (android_init_emacs_service): Link to new
function.
(android_detect_keyboard): New function.

* src/android.h: Update prototypes.

* src/androidfns.c (Fandroid_detect_keyboard)
(syms_of_androidfns): New function.
2024-02-06 17:53:23 +08:00
Po Lu
c1f8fe09e6 Fix frame focus tracking under Android
* java/org/gnu/emacs/EmacsActivity.java (invalidateFocus): New
argument WHENCE, a unique number identifying the circumstances
leading up to the call.  All callers changed.
(attachWindow): Call `invalidateFocus' from the UI thread.
(onWindowFocusChanged): Don't remove activity from
`focusedActivities' if it already exists should `hasWindowFocus'
return true.
2024-02-05 18:34:22 +08:00