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

378 commits

Author SHA1 Message Date
Eli Zaretskii
34f35407eb Bump Emacs version to 30.2.50
* README:
* configure.ac:
* exec/configure.ac:
* java/AndroidManifest.xml.in (Version-code):
* nt/README.W32:
* msdos/sed2v2.inp: Bump Emacs version to 30.2.50.

* etc/NEWS: Add headers for Emacs 30.2.
2025-08-14 06:46:32 -04:00
Eli Zaretskii
8ddef0ad4d Bump Emacs version
* README:
* configure.ac:
* exec/configure.ac:
* java/AndroidManifest.xml.in (Version-code):
* nt/README.W32:
* msdos/sed2v2.inp: Bump Emacs version to 30.2.
2025-08-14 03:52:16 -04:00
Eli Zaretskii
4c11021260 ; Bump Emacs version to 30.1.90
* README:
* configure.ac:
* exec/configure.ac:
* java/AndroidManifest.xml.in (Version-code):
* nt/README.W32:
* msdos/sed2v2.inp: Bump Emacs version to 30.1.90.
2025-05-18 05:08:31 -04:00
Po Lu
aa1b55d521 Fix the Android build
* java/README.res: Move from java/res/README, as the AAPT does
not permit non-resource files in resource directories.
2025-04-27 21:08:48 +08:00
Sean Whitton
4cd4a801d8 ; * java/res/README: Note origin of emacs_wrench.png. 2025-04-20 09:22:06 +08:00
Po Lu
c3c27e50a5 ; * java/AndroidManifest.xml.in (Version-code): Update for Emacs 30.0.50. 2025-03-06 21:41:10 +08:00
Po Lu
121371a706 Move java/incrementing-version-code to AndroidManifest.xml.in
* admin/admin.el (admin-android-version-code-regexp): New
variable.
(set-version): Modify AndroidManifest.xml.in instead.

* java/AndroidManifest.xml.in (Version-code): Define version
code.

* java/incrementing-version-code: Delete file.
2025-03-05 14:59:19 +08:00
Peter Oliver
8099dc6e3a Provide an Android version code derived from the Emacs version
The version code is intended to be an integer that increments
for each Android package release
(https://developer.android.com/studio/publish/versioning#versioningsettings).

If we keep this updated under version control, then F-Droid (a
third-party Android package repository), can watch for that, and
use it to automatically build Emacs packages for Android each
time a new Emacs release is tagged
(https://f-droid.org/en/docs/Build_Metadata_Reference/#UpdateCheckData).

* admin/admin.el (set-version): Update version code in
java/incrementing-version-code
* java/incrementing-version-code: New file containing an Android
version code corresponding to the current Emacs version.
(bug#75809)
2025-03-05 14:58:18 +08:00
Po Lu
ded77fefff Fix remaining Android bugs reported over the past months
* java/org/gnu/emacs/EmacsActivity.java (attachWindow):
Guarantee that child windows promoted to toplevels receive
layout parameters that direct them to receive their parents'
dimensions.  Otherwise, the size of the window as a child is
retained on Huawei HarmonyOS 4.2 and possibly other Android
distributions.

* java/org/gnu/emacs/EmacsService.java (updateCursorAnchorInfo):
Run anchor updates on the UI thread, as
`InputMethodManager#updateCursorAnchorInfo' is liable to call
`View#requestLayout'.

* java/org/gnu/emacs/EmacsView.java (onMeasure): Always call
`measureChildren', or child frames' onLayout handlers might not
be invoked after they request a layout cycle and are duly
processed in `onLayout'.
(swapBuffers): Delete erroneous commentary.

* java/org/gnu/emacs/EmacsWindow.java (viewLayout): If
overrideRedirect, don't inadvertently clear rect.left and
rect.top by recording the window's WM window-relative position.
Fix typos.
(reparentTo): Invalidate focus after transferring frame.
(translateCoordinates): Account for override-redirect windows.
Mostly important for mouse-drag-and-drop-region.
2025-02-19 20:40:12 +08:00
Po Lu
e97be722d3 Properly move existing tooltips on Android
* java/org/gnu/emacs/EmacsWindow.java (requestViewLayout): If an
override redirect window, additionally notify the window manager
of layout changes.
2025-02-19 15:34:51 +08:00
Po Lu
e3dc0ea254 Fix crash in frame deletion on Android
* java/org/gnu/emacs/EmacsWindow.java (destroyHandle):
Invalidate the input focus in the UI thread, as is proper.
2025-02-17 11:33:50 +08:00
Stefan Kangas
7fa975adbc Update copyright year to 2025
Run "TZ=UTC0 admin/update-copyright".
2025-01-02 18:39:42 +01:00
Po Lu
16462b1a62 Register for more Intents actions on Android
* java/AndroidManifest.xml.in <EmacsOpenActivity>: Register
for SEND Intents with mailto URIs.

* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Use
Intent constants rather than string literals.
2024-08-09 10:11:51 +08:00
Stefan Kangas
a6cab228d4 ; Fix typos 2024-07-18 11:46:50 +02:00
Po Lu
34882d5243 Port better to Android 3.0
* java/org/gnu/emacs/EmacsNoninteractive.java (main): Use the
old getPackageInfo calling convention if it exists rather than
on Android 2.3.3 and earlier.
2024-07-18 13:34:55 +08:00
Po Lu
b00fc31dd1 Do not set LD_LIBRARY_PATH during Android initialization
* doc/emacs/android.texi (Android Environment): Adjust
documentation to match.

* java/org/gnu/emacs/EmacsNoninteractive.java (main1): New
function.  Remove initialization of EmacsNative hither.
(main): Acquire an ApplicationInfo or LoadedApk, as the case may
be on the host system, derive a ClassLoader from the result, and
load and call `main1' from within this class loader.

* src/android-emacs.c (main):

* src/android.c (setEmacsParams): Do not override
LD_LIBRARY_PATH or set EMACS_LD_LIBRARY_PATH.  This enables
Emacs to execute subprocesses in certain "fortified" Android
systems, amongst other things.
2024-07-14 12:46:23 +08:00
Po Lu
e0b271e279 Take precautions against ill-formed content URIs
* java/org/gnu/emacs/EmacsService.java (openContentUri)
(checkContentUri): Verify that URIs derived from user-provided
file names can be parsed before attempting to open them.
2024-07-11 11:38:41 +08:00
Po Lu
67f291ddae Correct conditions for iconification on Android
* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity)
<isPaused>: Rename to <isStopped>.
(attachWindow): Adjust to match.
(onPause): Delete function.
(onStop): Deem frames iconified after calls to onStop instead.
2024-07-08 15:43:22 +08:00
Po Lu
ae38579420 * java/res/mipmap-v26/emacs_icon.xml: Define monospace icon. 2024-07-01 11:22:18 +08:00
Po Lu
64851d101a Improve Android "adaptive icon"
* java/res/drawable/emacs_background.xml:

* java/res/drawable/emacs_foreground.xml: Transform borders and
gradient colors to better align with the original.
2024-06-30 23:11:19 +08:00
Po Lu
860840621a Prevent crashes and related issues if initial activity is destroyed on Android
* java/org/gnu/emacs/EmacsWindow.java
(EmacsWindow) <initialWindowCreated>: New variable.
(EmacsWindow): If the initial frame has not yet been created,
set attachmentToken to -1.

* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow):
When the window's attachment token is -1 (i.e., it is the
default window), start EmacsActivity rather than
EmacsMultitaskActivity.  Catch exceptions around startActivity.
2024-06-27 11:07:38 +08:00
Po Lu
73a58329a6 Fix omission of updates to child frames on Android
* java/org/gnu/emacs/EmacsView.java (onAttachedFromWindow):
Force a layout cycle rather than report exposure immediately.
(prepareForLayout): Delete function.

* java/org/gnu/emacs/EmacsWindow.java (mapWindow): Remove
redundant calls to prepareForLayout.

* src/androidterm.c (handle_one_android_event): Do not swap
buffers when exposure is registered by a frame only partially
updated.
2024-06-24 12:04:05 +08:00
Po Lu
5fceb53856 Avoid races between the tooltip and compositor on X and Android
* java/org/gnu/emacs/EmacsView.java (onLayout): Don't send
exposure events when the window is still to be attached.

* src/androidfns.c (Fx_show_tip):

* src/xfns.c (Fx_show_tip): Block async input around initial
frame update.
2024-06-19 10:57:07 +08:00
Po Lu
fb04a51894 Fix window class of Android tooltips
* java/org/gnu/emacs/EmacsWindow.java (getWindowLayoutParams):
Declare as a panel, rather than an attached dialog.
2024-06-18 15:53:18 +08:00
Po Lu
3c2df93e06 * java/Makefile.in (emacs.apk-in): Don't compress *.gz files on SDK 8. 2024-06-18 10:11:51 +08:00
Po Lu
82f0014273 Reinforce bitmap reconfiguration on Android
* java/org/gnu/emacs/EmacsView.java (EmacsView) <unswapped>: New
field in which to record whether the back buffer has received
contents beyond those present at the last buffer swap.
<dimensionsLock>: Delete field.
(onAttachedToWindow, onLayout, handleDirtyBitmap)
(prepareForLayout): Rather, synchronize window dimensions with
the view.
(getCanvas, getBitmap): Do not reconfigure the back buffer
bitmap if such outstanding data exists.
(postSwapBuffers): New function.
(swapBuffers): If such outstanding data exists and the back
bufferis pending reconfiguration, recreate the back buffer and
report exposure.

* src/androidterm.c (handle_one_android_event): Fix indentation.
2024-06-17 17:45:48 +08:00
Stefan Kangas
c0eefebabf ; Fix typos 2024-06-16 22:38:26 +02:00
Po Lu
a39f6480ea Minor adjustments to battery.el on Android
* src/android.c (android_query_battery):

* java/org/gnu/emacs/EmacsService.java (queryBattery19)
(queryBattery): Reorder items in value for consistency with
Fandroid_query_battery.

* lisp/battery.el (battery-status-function): Select
battery-android only when android-query-battery is present.
(battery-android): Return temperature and correct values of
power source constants.
2024-06-16 15:28:54 +08:00
Po Lu
8d60b6bab8 Simplify bitmap reallocation on Android
* java/org/gnu/emacs/EmacsView.java: Update outdated commentary.
(handleDirtyBitmap): Don't copy contents of the previous bitmap
to the new.
(onLayout): Unconditionally expose upon layout changes.
2024-06-16 11:35:44 +08:00
Po Lu
6d64cf5ee1 Restore omitted dependency
* java/Makefile.in (install_temp): Depend on
$(libsrc)/asset-directory-tool.
2024-06-12 17:03:00 +08:00
Po Lu
02e70821b3 Restore functionality on Android 2.2
* java/Makefile.in (install_temp): Do not compress
directory-tree and generate such files in a special format that
stores file sizes.

* lib-src/asset-directory-tool.c (struct directory_tree): New
field st_size.
(need_file_size): New variable.
(main_1, main_2, main): Write file sizes before sibling offsets
if `--api-8' is specified.

* src/android-asset.h (struct android_asset_manager): New field
open.
(struct android_asset): New field name.
(AAssetManager_fromJava): Load AssetManager#open.
(AAssetManager_open): If a directory tree has already been
loaded, search for a matching asset and load its size thence, to
avoid the requirement of an AssetFileDescriptor.
(AAsset_close): Don't assume asset->fd exists.  Release
asset->name.
(AAsset_getLength): Likewise.
(android_asset_create_stream): If asset->name exists, call
AssetManager#open, in order to open compressed files.

* src/androidvfs.c (OLD_ANDROID_ASSETS): Define to 1 on API 8.
(android_extract_long, android_scan_directory_tree): Mark
arguments as const.  Adjust offsets when OLD_ANDROID_ASSETS.
(android_is_directory, android_init_assets, android_afs_readdir):
Likewise.

* src/lread.c (lread_fstat): Define to sys_fstat, not fstat.
2024-06-12 16:44:21 +08:00
Po Lu
f543ec18f4 ; * java/Makefile.in: Fix typo. 2024-06-12 13:59:08 +08:00
Po Lu
5fc75b051f Improve compression of Emacs packages on Android 2.2
* configure.ac (ZIP): Search for a `zip' executable and
substitute the same if targeting SDK 8.

* java/INSTALL: Document new requirement.

* java/Makefile.in (GZIP_PROG, ZIP): New substitutions.
(.PHONY): Delete references to directory-tree.

(install_temp): On SDK 8 and earlier, compress large *.el and
Info files with gzip, and divide install_temp into three
separate directories, with one for large files, another for
gzipped files, and one more for the remainder.
(install_temp/assets/directory-tree, install_temp/assets/version)
(install_temp/assets/build_info): Merge these rules into
install_tmp, that they may execute before the assets directory
is split.
(emacs.apk-in): Package each directory separately, accounting
for their varied compression requirements.

* lisp/term/android-win.el (input-decode-map): Define select to
return in input-decode-map.
2024-06-12 13:52:33 +08:00
Po Lu
677f082b0f Eliminate some redundant synchronization on Android
* java/org/gnu/emacs/EmacsService.java (resetIC): Return on all
versions of Android if the connection need not be reset.

* java/org/gnu/emacs/EmacsView.java (getICMode, setICMode):
Remove needless synchronization.
2024-06-11 14:40:55 +08:00
Po Lu
f1c9a32a23 Eliminate Makefile race
* java/Makefile.in (cf-stamp): Don't separately depend on
NDK_BUILD_SHARED, as this renders make liable to descend into
cross/ndk-build twice in different processes.
(clean): Don't remove nonexistent file.
2024-06-07 21:39:01 +08:00
Po Lu
43826a9109 ; * java/INSTALL (LIBRSVG): Typo. 2024-06-07 20:39:47 +08:00
Po Lu
7052654515 Document compilation of librsvg on Android
* java/INSTALL (LIBRSVG): New section.
(BUILDING WITH OLD NDK VERSIONS): Update recommended invocation
of configure in the case of a combined toolchain.
2024-06-07 20:39:46 +08:00
Po Lu
0467b756aa * java/AndroidManifest.xml.in: Revert portions of last change. 2024-06-06 09:16:03 +08:00
Paul Eggert
3dcac22dd4 Spelling fixes 2024-06-04 22:16:28 -07:00
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