aboutsummaryrefslogtreecommitdiffstats
path: root/java (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-04-18Correctly verify availability of Android content URIsPo Lu1-41/+13
* 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-14Remove leftover tasks from previous Emacs sessions on startupPo Lu3-19/+66
* 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-13Fix task-switching failures on Android 2.3Po Lu1-3/+9
* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow): Don't specify F_A_MULTIPLE_TASK on Android 4.4 and earlier.
2024-04-11Optimize R8 configurationPo Lu2-6/+35
* 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-11Adjust priority of Emacs background service notificationPo Lu1-2/+2
* java/org/gnu/emacs/EmacsService.java (onStartCommand): Reword lightly and set importance to IMPORTANCE_LOW.
2024-04-11; * java/Makefile.in: Render config.status relative to builddir.Po Lu1-3/+3
2024-04-10* java/Makefile.in (classes.dex): Make proguard.conf relative to srcdir.Po Lu1-2/+2
2024-04-10* java/proguard.conf: New file.Po Lu1-0/+24
2024-04-10Optimize generated Android DEX bytecodePo Lu1-2/+12
* 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-07Resolve disagreements in accounting of tooltip positions on AndroidPo Lu2-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.
2024-04-07Port new Android window management strategy to Android 5.0Po Lu1-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.
2024-04-06Correct typos in and omissions from earlier Android port changesPo Lu2-9/+9
* java/AndroidManifest.xml.in: Remove duplicate permissions. * java/org/gnu/emacs/EmacsWindowManager.java (removeWindowConsumer): Disregard isFinishing for non-initial activities.
2024-04-05Enable relinquishing access to Android content directoriesPo Lu1-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.
2024-04-04Avoid destroying windows after they are unmappedPo Lu3-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.
2024-04-03; * java/org/gnu/emacs/EmacsView.java (onKeyDown): Delete debugging code.Po Lu1-2/+0
2024-04-03Prevent detachWindow from deleting framesPo Lu1-1/+1
* java/org/gnu/emacs/EmacsWindowManager.java (detachWindow): Remove WINDOW from the window list prior to pruning.
2024-04-03; * java/org/gnu/emacs/EmacsWindow.java (reparentTo): Typo.Po Lu1-1/+1
2024-04-03Better align Emacs window management with Android task lifecyclesPo Lu7-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.
2024-03-30Always enable native JSON support and remove Jansson referencesMattias EngdegÄrd2-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.
2024-03-30Rationalize java/Makefile.inPo Lu1-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.
2024-03-29; * java/org/gnu/emacs/EmacsActivity.java (isReallyFinishing): Fix typo.Po Lu1-1/+1
2024-03-29Prevent Android OS task trimming from deleting Emacs framesPo Lu1-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.
2024-03-27Remove IME_FLAG_FORCE_ASCII from password input IME flagsPo Lu1-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.
2024-03-26Prevent focus "stalemates" on AndroidPo Lu1-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.
2024-03-26Prevent passwords from being recorded during text conversionPo Lu2-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.
2024-03-25Port restart-emacs to Android 4.3 and earlierPo Lu1-2/+22
* java/org/gnu/emacs/EmacsService.java (restartEmacs): Run Emacs from an alarm if required.
2024-03-24Improve consistency of content file name handlingPo Lu1-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.
2024-03-21Android compatibility fixesPo Lu5-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.
2024-03-20Respect file display names during Android drag-and-dropPo Lu2-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.
2024-03-19Respect display names of Android content URIsPo Lu3-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.
2024-03-17Improve C++ standard library detection on AndroidPo Lu2-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.
2024-03-14; * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Another fix.Po Lu1-2/+3
2024-03-13Fix crash when displaying notifications on Android 3.0Po Lu1-2/+4
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Don't call setPriority until Jelly Bean.
2024-03-13Port more notification senders to non-XDG systemsPo Lu1-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.
2024-03-12; Check in missing change to AndroidManifest.xml.inPo Lu1-0/+7
* java/AndroidManifest.xml.in: Register CancellationReceiver.
2024-03-12Implement notification residency on AndroidPo Lu1-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.
2024-03-12Fix notification cancellation detection on AndroidPo Lu1-4/+2
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Don't specify FLAG_ONE_SHOT in cancel intents.
2024-03-11Implement notification callbacks on AndroidPo Lu3-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.
2024-03-10; * java/org/gnu/emacs/EmacsPreferencesActivity.java: Fix commentary.Po Lu1-2/+3
2024-03-08Declare 124 new Android permissionsPo Lu1-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.
2024-02-24Fix bug#69321Po Lu1-20/+48
* java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp): Provide Right Alt (Alt Gr) masks to system keymap routines. (bug#69321)
2024-02-21* java/org/gnu/emacs/EmacsContextMenu.java (display): Reduce timeout.Po Lu1-7/+6
2024-02-21Work around premature dismissals of submenus under AndroidPo Lu1-1/+17
* java/org/gnu/emacs/EmacsContextMenu.java (display): If between HONEYCOMB and N, set wasSubmenuSelected.
2024-02-18Implement tooltip_reuse_hidden_frame for AndroidPo Lu1-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.
2024-02-17* java/debug.sh: Print errors correctly if device is ambiguous.Po Lu1-5/+8
2024-02-10Make miscellaneous improvements to the Android portPo Lu2-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.
2024-02-07Fix DEBUG_THREADS in the Android portPo Lu1-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.
2024-02-06Don't forcibly display dialogs on Android if a keyboard is presentPo Lu1-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.
2024-02-05Fix frame focus tracking under AndroidPo Lu2-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.
2024-01-26Avert race condition between window attachment and buffer swapPo Lu2-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.