aboutsummaryrefslogtreecommitdiffstats
path: root/java (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Resolve disagreements in accounting of tooltip positions on AndroidPo Lu2024-04-072-3/+21
| | | | | | | | | | * 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.
* Port new Android window management strategy to Android 5.0Po Lu2024-04-071-22/+28
| | | | | | | | | | * 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.
* Correct typos in and omissions from earlier Android port changesPo Lu2024-04-062-9/+9
| | | | | | | | * java/AndroidManifest.xml.in: Remove duplicate permissions. * java/org/gnu/emacs/EmacsWindowManager.java (removeWindowConsumer): Disregard isFinishing for non-initial activities.
* Enable relinquishing access to Android content directoriesPo Lu2024-04-051-0/+15
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* Avoid destroying windows after they are unmappedPo Lu2024-04-043-8/+20
| | | | | | | | | | | * 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.
* ; * java/org/gnu/emacs/EmacsView.java (onKeyDown): Delete debugging code.Po Lu2024-04-031-2/+0
|
* Prevent detachWindow from deleting framesPo Lu2024-04-031-1/+1
| | | | | * java/org/gnu/emacs/EmacsWindowManager.java (detachWindow): Remove WINDOW from the window list prior to pruning.
* ; * java/org/gnu/emacs/EmacsWindow.java (reparentTo): Typo.Po Lu2024-04-031-1/+1
|
* Better align Emacs window management with Android task lifecyclesPo Lu2024-04-037-255/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Always enable native JSON support and remove Jansson referencesMattias EngdegÄrd2024-03-302-9/+1
| | | | | | | | | | | | | | | | | | | | | * 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.
* Rationalize java/Makefile.inPo Lu2024-03-301-7/+6
| | | | | | * 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.
* ; * java/org/gnu/emacs/EmacsActivity.java (isReallyFinishing): Fix typo.Po Lu2024-03-291-1/+1
|
* Prevent Android OS task trimming from deleting Emacs framesPo Lu2024-03-291-1/+54
| | | | | | | | | | | | | * 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.
* Remove IME_FLAG_FORCE_ASCII from password input IME flagsPo Lu2024-03-271-4/+1
| | | | | | | * 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.
* Prevent focus "stalemates" on AndroidPo Lu2024-03-261-3/+14
| | | | | | | * 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.
* Prevent passwords from being recorded during text conversionPo Lu2024-03-262-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Port restart-emacs to Android 4.3 and earlierPo Lu2024-03-251-2/+22
| | | | | * java/org/gnu/emacs/EmacsService.java (restartEmacs): Run Emacs from an alarm if required.
* Improve consistency of content file name handlingPo Lu2024-03-241-9/+39
| | | | | | * 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.
* Android compatibility fixesPo Lu2024-03-215-30/+64
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* Respect file display names during Android drag-and-dropPo Lu2024-03-202-4/+18
| | | | | | | | | | | | * 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.
* Respect display names of Android content URIsPo Lu2024-03-193-8/+91
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Improve C++ standard library detection on AndroidPo Lu2024-03-172-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* ; * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Another fix.Po Lu2024-03-141-2/+3
|
* Fix crash when displaying notifications on Android 3.0Po Lu2024-03-131-2/+4
| | | | | * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Don't call setPriority until Jelly Bean.
* Port more notification senders to non-XDG systemsPo Lu2024-03-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* ; Check in missing change to AndroidManifest.xml.inPo Lu2024-03-121-0/+7
| | | | * java/AndroidManifest.xml.in: Register CancellationReceiver.
* Implement notification residency on AndroidPo Lu2024-03-121-0/+25
| | | | | | | | | | | | | | | | | | | * 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.
* Fix notification cancellation detection on AndroidPo Lu2024-03-121-4/+2
| | | | | * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Don't specify FLAG_ONE_SHOT in cancel intents.
* Implement notification callbacks on AndroidPo Lu2024-03-113-13/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* ; * java/org/gnu/emacs/EmacsPreferencesActivity.java: Fix commentary.Po Lu2024-03-101-2/+3
|
* Declare 124 new Android permissionsPo Lu2024-03-081-0/+126
| | | | | | | | | | * doc/emacs/android.texi (Android Environment): Document new permissions and delete recently introduced permissions from the list for Android 5.1 and earlier. * java/AndroidManifest.xml.in: Declare 124 new permissions to enable invoking features they protect from code running inside Emacs.
* Fix bug#69321Po Lu2024-02-241-20/+48
| | | | | | * java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp): Provide Right Alt (Alt Gr) masks to system keymap routines. (bug#69321)
* * java/org/gnu/emacs/EmacsContextMenu.java (display): Reduce timeout.Po Lu2024-02-211-7/+6
|
* Work around premature dismissals of submenus under AndroidPo Lu2024-02-211-1/+17
| | | | | * java/org/gnu/emacs/EmacsContextMenu.java (display): If between HONEYCOMB and N, set wasSubmenuSelected.
* Implement tooltip_reuse_hidden_frame for AndroidPo Lu2024-02-181-5/+22
| | | | | | | | | | * 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.
* * java/debug.sh: Print errors correctly if device is ambiguous.Po Lu2024-02-171-5/+8
|
* Merge from origin/emacs-29Eli Zaretskii2024-02-101-1/+1
| | | | | | | | | | | | | | | | 7d3a1444864 ; Mention defface's and their :version tags in CONTRIBUTE. 09c53b717d4 * admin/notes/kind-communication: New file. 31ca4e5501f ; And another fix of CONTRIBUTE. d65499e7908 ; Another clarification in CONTRIBUTE. 571ec583d64 ; Clarify "ChangeLog entries" in CONTRIBUTE. e2682316867 Don't skip links to "." and ".." in Dired when marking files e25d11314d8 Pass unquoted filename to user-supplied MUSTMATCH predicate 47496993703 * doc/lispref/parsing.texi (Retrieving Nodes): Improve do... d0673ea0d42 ; * etc/PROBLEMS: Workaround for Windows key "stuck" (bug... * lisp/emacs-lisp/trace.el: * java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Remove training whitespace.
* Make miscellaneous improvements to the Android portPo Lu2024-02-102-66/+5
| | | | | | | | | | | | | | | | * 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.
* Fix DEBUG_THREADS in the Android portPo Lu2024-02-071-1/+12
| | | | | | | | * 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.
* Don't forcibly display dialogs on Android if a keyboard is presentPo Lu2024-02-061-0/+10
| | | | | | | | | | | | | | | | | * 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.
* Fix frame focus tracking under AndroidPo Lu2024-02-052-10/+26
| | | | | | | | | | * 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.
* Avert race condition between window attachment and buffer swapPo Lu2024-01-262-12/+43
| | | | | | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsView.java (swapBuffers): Synchronize such that code cannot execute between the bitmap's being loaded and being transferred to surfaceView. (onDetachedFromWindow): Recycle bitmap after the surface view is reset. * java/org/gnu/emacs/EmacsWindow.java (recreateActivity): * src/android.c (android_init_emacs_window) (android_recreate_activity): * src/androidfns.c (Fandroid_recreate_activity) (syms_of_androidfns): New functions for debugging window attachment. * src/androidgui.h: Update prototypes.
* ; Add 2024 to copyright yearsPo Lu2024-01-0256-56/+56
|
* Simplify code relating to UI thread synchronizationPo Lu2023-12-303-146/+115
| | | | | | | | | | | | | * java/org/gnu/emacs/EmacsContextMenu.java (display): * java/org/gnu/emacs/EmacsDialog.java (display): * java/org/gnu/emacs/EmacsService.java (getEmacsView) (getLocationOnScreen, getClipboardManager) (requestDirectoryAccess): Replace manual synchronization within Runnable objects by usage of FutureTask. (syncRunnable): Accept FutureTask<V> in place of Runnables, and obtain and return results from calls to its get method.
* ; Fix typoStefan Kangas2023-12-171-3/+3
| | | | | * java/org/gnu/emacs/EmacsSafThread.java (cacheDirectoryFromCursor): Fix typo.
* Provide for Num Lock and Scroll Lock on AndroidPo Lu2023-12-161-4/+24
| | | | | | * java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp): Retain META_NUM_LOCK_ON and META_SCROLL_LOCK_ON while filtering meta state.
* ; Fix a few more typosStefan Kangas2023-12-101-1/+1
|
* ; Fix typosStefan Kangas2023-12-108-14/+14
|
* Prevent closing Emacs frames upon locale changesPo Lu2023-12-071-2/+2
| | | | | * java/AndroidManifest.xml.in: Express that Emacs can respond to locale and fontScale changes.
* Clean up some redundant or otherwise suspect codePo Lu2023-11-293-6/+2
| | | | | | | | | | | | | * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Don't check if URI is non-NULL, for instanceof checks this also. * java/org/gnu/emacs/EmacsSafThread.java (accessDocument1): Don't check !writable twice. * java/org/gnu/emacs/EmacsService.java (documentIdFromName): Designate this function as public, since it is called through JNI.