aboutsummaryrefslogtreecommitdiffstats
path: root/java (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-07-18; Fix typosStefan Kangas1-1/+1
2024-07-18Port better to Android 3.0Po Lu1-4/+4
* 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-14Do not set LD_LIBRARY_PATH during Android initializationPo Lu1-113/+137
* 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-11Take precautions against ill-formed content URIsPo Lu1-1/+17
* 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-08Correct conditions for iconification on AndroidPo Lu1-14/+9
* 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-01* java/res/mipmap-v26/emacs_icon.xml: Define monospace icon.Po Lu1-0/+1
2024-06-30Improve Android "adaptive icon"Po Lu2-27/+25
* 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-30Respect --disable-build-details in Android buildsPo Lu1-3/+7
* java/Makefile.in (BUILD_DETAILS, GEN_BUILD_DETAILS): New variables. (install_tmp): Tolerate failures in generation of metadata files and prefix commands for such generation with GEN_BUILD_DETAILS. * lisp/version.el (android-read-build-system) (android-read-build-time): Return nil if metadata file does not exist.
2024-06-27Prevent crashes and related issues if initial activity is destroyed on AndroidPo Lu2-7/+47
* 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-24Fix omission of updates to child frames on AndroidPo Lu2-23/+17
* 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-19Avoid races between the tooltip and compositor on X and AndroidPo Lu1-1/+1
* 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-18Fix window class of Android tooltipsPo Lu1-1/+1
* java/org/gnu/emacs/EmacsWindow.java (getWindowLayoutParams): Declare as a panel, rather than an attached dialog.
2024-06-18* java/Makefile.in (emacs.apk-in): Don't compress *.gz files on SDK 8.Po Lu1-1/+1
2024-06-17Reinforce bitmap reconfiguration on AndroidPo Lu1-68/+93
* 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-16; Fix typosStefan Kangas1-2/+2
2024-06-16Minor adjustments to battery.el on AndroidPo Lu1-2/+2
* 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-16Simplify bitmap reallocation on AndroidPo Lu1-18/+17
* 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-12Restore omitted dependencyPo Lu1-1/+2
* java/Makefile.in (install_temp): Depend on $(libsrc)/asset-directory-tool.
2024-06-12Restore functionality on Android 2.2Po Lu1-1/+3
* 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; * java/Makefile.in: Fix typo.Po Lu1-1/+1
2024-06-12Improve compression of Emacs packages on Android 2.2Po Lu2-31/+100
* 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-11Eliminate some redundant synchronization on AndroidPo Lu2-7/+15
* 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-07Eliminate Makefile racePo Lu1-2/+6
* 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; * java/INSTALL (LIBRSVG): Typo.Po Lu1-1/+1
2024-06-07Document compilation of librsvg on AndroidPo Lu1-13/+45
* java/INSTALL (LIBRSVG): New section. (BUILDING WITH OLD NDK VERSIONS): Update recommended invocation of configure in the case of a combined toolchain.
2024-06-06* java/AndroidManifest.xml.in: Revert portions of last change.Po Lu1-2/+0
2024-06-04Spelling fixesPaul Eggert6-8/+8
2024-06-04Provide additional Android metadataPo Lu1-0/+5
* 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-04Enable downgrading between this and future releases of EmacsPo Lu1-6/+10
* java/AndroidManifest.xml.in: Fix `versionCode' at 30.
2024-06-02Trim redundancies from EmacsTileObjectPo Lu1-4/+1
* java/org/gnu/emacs/EmacsTileObject.java (EmacsTileObject) <colorFilter>: Delete unused field. <paint>: Qualify as `static'.
2024-05-23Work around one Android bug and document anotherPo Lu2-13/+23
* 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-22Improve compatibility with Android's default text editorPo Lu1-0/+17
* 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-18Housekeeping around androidselect.cPo Lu3-58/+22
* 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-13Communicate frame titles to the window manager on AndroidPo Lu2-1/+69
* 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-12Additional changes to processing of Num Lock on AndroidPo Lu2-31/+57
* 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-12Correct earlier changes to processing of Num Lock on AndroidPo Lu1-10/+4
* 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-11Delete unused functionsPo Lu1-6/+0
* java/org/gnu/emacs/EmacsNative.java (dup, close): * src/android.c (dup, close): Delete functions no longer referenced.
2024-05-10Remove redundant encoding of strings in androidvfs.cPo Lu1-12/+5
* 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-10Fix earlier change to content URI resolution on AndroidPo Lu1-1/+4
* 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-08Fix hang after failed yank-media on AndroidPo Lu3-27/+11
* 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-06; * java/org/gnu/emacs/EmacsTileObject.java: Fix copyright dates.Po Lu1-1/+1
2024-05-06Optimize stipples on AndroidPo Lu2-11/+105
* 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-05Fix inadvertent removal in EmacsWindowPo Lu1-0/+4
* java/org/gnu/emacs/EmacsWindow.java (onKeyUp): Send KeyPress events upon deferred KEYCODE_BACK.
2024-05-04Simplify handling of command-line arguments on AndroidPo Lu5-41/+32
* 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-04Simplify management of Android handle IDsPo Lu12-75/+66
* 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-02Port visible bell to AndroidPo Lu4-82/+56
* 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-01Fix compatibility issues with Android clipboardsPo Lu5-74/+33
* 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-04-29; Delete obsolete commentaryPo Lu1-6/+0
* java/org/gnu/emacs/EmacsDrawLine.java (perform): Delete obsolete commentary.
2024-04-28Implement dots and dashes on AndroidPo Lu3-11/+113
* 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-27Enable customization of the quit key on AndroidPo Lu2-10/+11
* 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.