1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00
Commit graph

339 commits

Author SHA1 Message Date
Po Lu
2a699edbe5 Provide additional Android metadata
* java/AndroidManifest.xml.in: Enable preserving user data
beyond uninstallation, restarting activities without persiting
state, increase maximum number of simultaneously open
activities, and provide a sensible category.
2024-06-04 10:23:13 +08:00
Po Lu
d812e94dde Enable downgrading between this and future releases of Emacs
* java/AndroidManifest.xml.in: Fix `versionCode' at 30.
2024-06-04 10:03:01 +08:00
Po Lu
253b1d6ee8 Trim redundancies from EmacsTileObject
* java/org/gnu/emacs/EmacsTileObject.java (EmacsTileObject)
<colorFilter>: Delete unused field.
<paint>: Qualify as `static'.
2024-06-02 16:37:39 +08:00
Po Lu
e96e4906c8 Work around one Android bug and document another
* etc/PROBLEMS (Runtime problems specific to Android): Document
deficiency of "Android Keyboard (AOSP)."

* java/org/gnu/emacs/EmacsView.java (showOnScreenKeyboard):
Revert yesterday's change.

* java/org/gnu/emacs/EmacsWindow.java (toggleOnScreenKeyboard):
Sync with the UI thread after displaying the on-screen keyboard.
2024-05-23 17:46:48 +08:00
Po Lu
70effed88d Improve compatibility with Android's default text editor
* java/org/gnu/emacs/EmacsView.java (showOnScreenKeyboard):
Request a selection update if `inputConnection' has been
established, to more closely emulate the OS text editing widget.
(onCreateInputConnection) [EmacsService.DEBUG_IC]: Print current
selection values before reporting them.
2024-05-22 22:00:26 +08:00
Po Lu
8dc00dc222 Housekeeping around androidselect.c
* java/org/gnu/emacs/EmacsClipboard.java (setClipboard)
(getClipboard):

* java/org/gnu/emacs/EmacsSdk11Clipboard.java (setClipboard)
(getClipboard):

* java/org/gnu/emacs/EmacsSdk8Clipboard.java (setClipboard)
(getClipboard): Save and return Strings rather than byte arrays.

* src/androidselect.c (android_init_emacs_clipboard)
(Fandroid_set_clipboard, Fandroid_get_clipboard): Adjust to
match.
2024-05-18 20:45:35 +08:00
Po Lu
9443f8145e Communicate frame titles to the window manager on Android
* java/org/gnu/emacs/EmacsActivity.java (detachWindow)
(attachWindow): Call updateWmName.
(updateWmName): New function; transfer wm name from the window
attached to the task's description.

* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow)
<wmName>: New field.
(setWmName): New function.

* src/android.c (android_init_emacs_window): Link to new
function.
(android_set_wm_name): New function.

* src/android.h (struct android_emacs_service): Delete unused
entries.

* src/androidfns.c (android_set_name_internal, android_set_name)
(android_implicitly_set_name, android_explicitly_set_name)
(android_set_title): Port from X.

* src/androidterm.c (android_term_init): Compute default frame
title.

* src/androidterm.h (struct android_display_info) <x_id_name>:
New field.
2024-05-13 14:42:35 +08:00
Po Lu
ea98a6af2f Additional changes to processing of Num Lock on Android
* java/org/gnu/emacs/EmacsView.java (onKeyDown, onKeyMultiple)
(onKeyDown): Disregard Num and Scroll Lock keys, and return
value of window functions to the system.

* java/org/gnu/emacs/EmacsWindow.java (eventModifiers): Return
normalized meta state, not only those bits the system considers
modifiers.
(onKeyDown, onKeyUp): Ignore numpad keys to which no base
characters are assigned, so that the system may generate the
proper action keys instead.
2024-05-12 15:49:53 +08:00
Po Lu
af6df8e045 Correct earlier changes to processing of Num Lock on Android
* java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp):
Cease stripping META_NUM_LOCK_ON and META_SCROLL_LOCK_ON from
meta masks reported to getUnicodeChar.
2024-05-12 15:49:53 +08:00
Po Lu
3ff83246c8 Delete unused functions
* java/org/gnu/emacs/EmacsNative.java (dup, close):

* src/android.c (dup, close): Delete functions no longer
referenced.
2024-05-11 14:34:32 +08:00
Po Lu
ea2b251ab2 Remove redundant encoding of strings in androidvfs.c
* java/org/gnu/emacs/EmacsService.java (getDocumentTrees):
Accept PROVIDER as a String.

* src/android.c (android_init_emacs_service):

* src/androidvfs.c (android_saf_root_opendir): Adjust to match.
2024-05-10 11:42:37 +08:00
Po Lu
c900c707e8 Fix earlier change to content URI resolution on Android
* java/org/gnu/emacs/EmacsService.java (openContentUri): Return
-1 if fd be NULL.

* src/androidvfs.c (android_authority_open): Detect
SecurityException and suchlike.
(android_vfs_init): Initialize exception classes on Android 4.4.
2024-05-10 09:05:54 +08:00
Po Lu
e020f4e9ce Fix hang after failed yank-media on Android
* java/org/gnu/emacs/EmacsClipboard.java (getClipboardTargets)
(getClipboardData):

* java/org/gnu/emacs/EmacsSdk11Clipboard.java
(getClipboardTargets, getClipboardData):

* java/org/gnu/emacs/EmacsSdk8Clipboard.java
(getClipboardTargets, getClipboardData): Return string data as
Strings rather than byte arrays.

* src/androidselect.c (android_init_emacs_clipboard)
(Fandroid_get_clipboard_targets): Adjust to match.
(extract_fd_offsets): Remove duplicated semicolon.
(Fandroid_get_clipboard_data): Call unblock_input before
returning if extract_fd_offsets fails.
2024-05-08 16:03:49 +08:00
Po Lu
5bf4ff806b ; * java/org/gnu/emacs/EmacsTileObject.java: Fix copyright dates. 2024-05-06 17:23:57 +08:00
Po Lu
2f36fc1b4f Optimize stipples on Android
* java/org/gnu/emacs/EmacsGC.java (EmacsGC) <tileObject>:
Change type to EmacsTileObject.
(markDirty): Create an EmacsTileObject rather than a
BitmapDrawable.

* java/org/gnu/emacs/EmacsTileObject.java: New file,
significantly leaner than BitmapDrawable.
2024-05-06 12:09:21 +08:00
Po Lu
51791fd178 Fix inadvertent removal in EmacsWindow
* java/org/gnu/emacs/EmacsWindow.java (onKeyUp): Send KeyPress
events upon deferred KEYCODE_BACK.
2024-05-05 09:03:57 +08:00
Po Lu
41dd78cd36 Simplify handling of command-line arguments on Android
* java/org/gnu/emacs/EmacsActivity.java
(EXTRA_STARTUP_ARGUMENTS): New constant.
(onCreate): Read a string array, not a string extra from the
intent with this key.

* java/org/gnu/emacs/EmacsOpenActivity.java (EmacsOpenActivity)
<fileToOpen>: Delete field.
(onCreate): Provide file name as a command line argument when
starting the Emacs service.

* java/org/gnu/emacs/EmacsPreferencesActivity.java (startEmacsQ)
(startEmacsDebugInit): In like manner, replace ad-hoc
command-line argument extra with a proper array.

* java/org/gnu/emacs/EmacsService.java (EmacsService): Rename
extraStartupArgument to extraStartupArguments, and change its
type to a string array.
(onCreate): Adjust to match.

* java/org/gnu/emacs/EmacsThread.java (EmacsThread)
<extraStartupArguments>: Ditto.
<fileToOpen>: Delete field.
(run): Adjust correspondingly.
2024-05-04 16:13:24 +08:00
Po Lu
139931fefb Simplify management of Android handle IDs
* java/org/gnu/emacs/EmacsCursor.java (EmacsCursor):

* java/org/gnu/emacs/EmacsGC.java (EmacsGC):

* java/org/gnu/emacs/EmacsHandleObject.java (EmacsHandleObject):
Remove HANDLE argument to constructor.

* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap):

* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow):

* java/org/gnu/emacs/EmacsInputConnection.java
(EmacsInputConnection) <windowHandle>: Change type to long.

* java/org/gnu/emacs/EmacsNative.java (EmacsNative)
(sendConfigureNotify, sendKeyPress, sendKeyRelease, sendFocusIn)
(sendFocusOut, sendWindowAction, sendEnterNotify)
(sendLeaveNotify, sendMotionNotify, sendButtonPress)
(sendButtonRelease, sendTouchDown, sendTouchUp, sendTouchMove)
(sendWheel, sendIconified, sendDeiconified, sendContextMenu)
(sendExpose, sendDndDrag, sendDndUri, sendDndText)
(beginBatchEdit, commitCompletion, endBatchEdit, commitText)
(deleteSurroundingText, finishComposingText, replaceText)
(getSelectedText, getTextAfterCursor, getTextBeforeCursor)
(setComposingText, setComposingRegion, setSelection)
(performEditorAction, performContextMenuAction, getExtractedText)
(requestSelectionUpdate, requestCursorUpdates, clearInputFlags)
(getSurroundingText, takeSnapshot, getSelection): Accept handles
as longs, rather than shorts.  All callers changed.

* java/org/gnu/emacs/EmacsService.java (queryTree): Return
handles as longs rather than shorts.
(viewGetSelection): Take long WINDOW, not short.

* src/android.c (struct android_emacs_handle): New structure.
(handle_class): New variable.
(android_init_emacs_service, android_init_emacs_pixmap)
(android_init_emacs_gc_class, android_init_emacs_cursor): Adjust
to match signature changes in constructors.
(android_init_emacs_handle): New function.
(initEmacs): Initialize the handle class, its fields and metods.
(sendConfigureNotify, sendKeyPress, sendKeyRelease, sendFocusIn)
(sendFocusOut, sendWindowAction, sendEnterNotify)
(sendLeaveNotify, sendMotionNotify, sendButtonPress)
(sendButtonRelease, sendTouchDown, sendTouchUp, sendTouchMove)
(sendWheel, sendIconified, sendDeiconified, sendContextMenu)
(sendExpose, sendDndDrag, sendDndUri, sendDndText): Update for
changes to handle type.
(android_alloc_id, android_resolve_handle)
(android_resolve_handle2): Remove functions; replace the second
with a macro that accepts one fewer argument.  All callers
changed.
(android_destroy_handle): Cease indexing the handle list for the
handle object.
(android_globalize_reference): New function.
(android_create_window, android_create_gc, android_create_pixmap)
(android_create_font_cursor): Call android_globalize_reference
to convert global references into handles.
(android_free_cursor, android_destroy_window): Cease verifying
the handle type.
(android_copy_area): Check destination object type rather than
handle entry.
(android_query_tree): Adjust for changes to return types.
(likely): Define __builtin_expect variant unconditionally.

* src/android.h (android_resolve_handle): New macro.

* src/androidgui.h (android_handle): Define to intptr_t.

* src/androidterm.c (deleteSurroundingText, finishComposingText)
(performEditorAction, performContextMenuAction, getExtractedText)
(getSelectedText, requestSelectionUpdate, requestCursorUpdates)
(clearInputFlags, getSurroundingText)
(android_get_surrounding_text_internal): Accept handles as
longs, not jshorts.
2024-05-04 11:36:09 +08:00
Po Lu
b84fa71f89 Port visible bell to Android
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Ignore
GC_INVERT.

* java/org/gnu/emacs/EmacsFillRectangle.java
(EmacsFillRectangle) <invertFilter>: New variable.
(perform): If the transfer mode is invert, copy the source
to itself with invertFilter as the color filter.

* java/org/gnu/emacs/EmacsGC.java (EmacsGC) <xorAlu, srcInAlu>:
Delete now-redundant ALUs.
(markDirty): Cease updating the paint's transfermode.

* java/org/gnu/emacs/EmacsSafThread.java (openDocument1): Fix
typo in documentation.

* src/android.c (android_blit_xor): Delete unused function.
(android_copy_area): Remove calls to unused blit functions.

* src/androidgui.h (enum android_gc_function): Rename XOR to
INVERT.

* src/androidterm.c (android_flash): Replace with GXinvert.
2024-05-02 11:31:37 +08:00
Po Lu
2451456695 Fix compatibility issues with Android clipboards
* java/org/gnu/emacs/EmacsClipboard.java (getClipboardData):
Return an AssetFileDescriptor.

* java/org/gnu/emacs/EmacsContextMenu.java (onMenuItemClick):
Typo corrections in commentary.

* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Raise
minimum version on which to read file descriptors from
ParcelFileDescriptor objects to Honeycomb.

* java/org/gnu/emacs/EmacsSdk11Clipboard.java
(getClipboardData): Return the asset file descriptor.

* java/org/gnu/emacs/EmacsSdk8Clipboard.java (getClipboardData):
Adjust return type to match.

* src/android.h (struct android_parcel_file_descriptor_class):
Move from androidselect.c.

* src/androidselect.c (fd_class): Export function.
(android_init_emacs_clipboard): Adjust signature of
getClipboardData.
(android_init_asset_file_descriptor, close_asset_fd)
(extract_fd_offsets): New functions.
(Fandroid_get_clipboard_data): Extract file descriptor and
offset from the AssetFileDescriptor here, rather than in
getClipboardData.
(init_androidselect): Call android_init_asset_file_descriptor.

* src/androidvfs.c (android_init_fd_class): Export and enable
calling this function more than once.
2024-05-01 11:46:31 +08:00
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
931cd93313 ; * java/Makefile.in: Fix typos. 2024-04-22 16:37:01 +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
2675c2824f * java/INSTALL: Update instructions. 2024-04-19 17:39:29 +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
2733329b46 ; * java/Makefile.in: Render config.status relative to builddir. 2024-04-11 09:16:57 +08:00
Po Lu
15bafc0432 * java/Makefile.in (classes.dex): Make proguard.conf relative to srcdir. 2024-04-10 23:22:38 +08:00
Po Lu
049bdfdaec * java/proguard.conf: New file. 2024-04-10 22:33:33 +08:00
Po Lu
ed88bed3af Optimize generated Android DEX bytecode
* configure.ac (D8): Attempt to locate the bundle where d8 is
installed, detect whether an installation of `r8' is similarly
present, and use this installation in place of d8 if so.

* java/Makefile.in (ANDROID_MIN_SDK, IS_D8_R8): New
substitutions.
(classes.dex): Provide --min-api, --debug or --release and
--pg-conf to d8 or r8.
2024-04-10 22:33:08 +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
4c9926fed1 Rationalize java/Makefile.in
* java/Makefile.in: (emacs.apk-in): Bring commentary up to date,
and package classes.dex at this stage of the process.
($(APK_NAME)): Adjust to match.
2024-03-30 09:59:36 +08:00