aboutsummaryrefslogtreecommitdiffstats
path: root/java (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-12-17; Fix typoStefan Kangas1-3/+3
* java/org/gnu/emacs/EmacsSafThread.java (cacheDirectoryFromCursor): Fix typo.
2023-12-16Provide for Num Lock and Scroll Lock on AndroidPo Lu1-4/+24
* java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp): Retain META_NUM_LOCK_ON and META_SCROLL_LOCK_ON while filtering meta state.
2023-12-10; Fix a few more typosStefan Kangas1-1/+1
2023-12-10; Fix typosStefan Kangas8-14/+14
2023-12-07Prevent closing Emacs frames upon locale changesPo Lu1-2/+2
* java/AndroidManifest.xml.in: Express that Emacs can respond to locale and fontScale changes.
2023-11-29Clean up some redundant or otherwise suspect codePo Lu3-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.
2023-11-25Dismiss Android Back key events that are canceledPo Lu1-6/+31
* java/org/gnu/emacs/EmacsWindow.java (onKeyDown): Disregard KEYCODE_BACK events. (onKeyUp): If the event is KEYCODE_BACK, deliver the disregarded key press event, unless FLAG_CANCELED is set.
2023-11-18Offer to grant storage permissions if absentPo Lu1-0/+122
* java/org/gnu/emacs/EmacsService.java (externalStorageAvailable) (requestStorageAccess23, requestStorageAccess30) (requestStorageAccess): New functions. * lisp/startup.el (fancy-startup-tail, normal-splash-screen): Call android-win functions for inserting the new storage permission notice. * lisp/term/android-win.el (android-display-storage-permission-popup) (android-after-splash-screen): New functions. * src/android.c (android_init_emacs_service): Link to new Java functions. (android_external_storage_available_p) (android_request_storage_access): New functions. * src/android.h: Update prototypes. * src/androidfns.c (Fandroid_external_storage_available_p) (Fandroid_request_storage_access): New functions. (syms_of_androidfns): Register new subrs.
2023-11-15Register ``pinch to zoom'' touch screen gesturesPo Lu1-2/+2
* doc/emacs/input.texi (Touchscreens): Address pinch gestures. * doc/lispref/commands.texi (Touchscreen Events): Address touch screen pinch events and the process by which they are produced. * java/org/gnu/emacs/EmacsWindow.java (figureChange) <ACTION_POINTER_DOWN>: Supply pointer index to getX and getY, correcting a mistake where the first touch point's coordinate was saved here in lieu of the pointer that was pressed's. * lisp/touch-screen.el (touch-screen-current-tool): Revise doc string. (touch-screen-aux-tool): New variable. (touch-screen-scroll-point-to-y, touch-screen-pinch): New functions. (global-map): Bind [touchscreen-pinch] to touch-screen-pinch. (touch-screen-handle-point-update): Revise doc string; set new tenth field of t-s-c-t to POINT relative to its window, without regard to whether an event has been sent. (touch-screen-distance, touch-screen-centrum): New functions. (touch-screen-handle-aux-point-update): New function; generate and send touchscreen-pinch if need be. (touch-screen-handle-point-up): If an ancillary tool exists, transfer the information there into touch-screen-current-tool and clear t-s-a-t. (touch-screen-handle-touch): Call t-s-a-p-u as is proper; set t-s-a-t if a touchscreen-down event arrives and t-s-c-t is set. * src/androidterm.c (handle_one_android_event): Properly save the event's X and Y when a new touch point is registered.
2023-11-14Properly merge EXTRA_EMAIL content with mailto URIsPo Lu1-6/+7
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): EXTRA_EMAIL is an array rather than a string, so insert its first element into an empty mailto URI.
2023-11-12Adjust dump file location under AndroidPo Lu2-36/+71
* java/org/gnu/emacs/EmacsApplication.java (EmacsApplication) <apkFileName>: New field. (getApkFile): Move from EmacsService.java. (findDumpFile): If the dump file is older than the APK, delete it irrespective of whether the checksums agree. (onCreate): Initialize apkFileName. * java/org/gnu/emacs/EmacsService.java (onCreate): Use EmacsApplication.apkFileName. * src/android.c (android_on_low_memory): Correct arguments to Fclear_image_cache. * src/image.c (Fclear_image_cache): Check that animation_cache is always a cons.
2023-11-10Clear image caches in reaction to system VM warningsPo Lu2-0/+15
* java/org/gnu/emacs/EmacsNative.java (onLowMemory): * java/org/gnu/emacs/EmacsService.java (onLowMemory): New function. * src/android.c (android_on_low_memory, onLowMemory): New functions called when a VM caution is registered. Clear the image cache and run garbage collection.
2023-11-09Guarantee files are auto-saved when Emacs is terminated by AndroidPo Lu2-0/+16
* java/org/gnu/emacs/EmacsNative.java (shutDownEmacs): * java/org/gnu/emacs/EmacsService.java (onDestroy): New function. When invoked, call shut_down_emacs and await its completion. * src/android.c (android_shut_down_emacs, shutDownEmacs): New functions.
2023-10-29Avert a crash and file descriptor leak in yank-mediaPo Lu2-0/+27
* java/org/gnu/emacs/EmacsNative.java (close): New declaration. * java/org/gnu/emacs/EmacsSdk11Clipboard.java (getClipboardData): Catch SecurityException and guarantee file descriptors are closed even if exceptions arise. * src/android.c (dup): Export another function.
2023-10-28Minor adjustments to Android drag and drop and content URIsPo Lu1-3/+30
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow) <dndXPosition, dndYPosition>: New fields initialized to -1. (onDragEvent): Remember the position of the previous event to avoid sending duplicates. * src/androidvfs.c (EMACS_PATH_MAX): New define. (android_saf_tree_rename, android_saf_tree_opendir) (android_name_file, android_fstatat, android_faccessat) (android_fchmodat, android_readlinkat): Use EMACS_PATH_MAX where SAF file names might be encountered.
2023-10-21Facilitate opening multiple files through DND under AndroidPo Lu1-26/+43
* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Agglomerate each provided content URI into a text/uri list.
2023-10-20Repair detection of empty mailto URLsPo Lu1-1/+1
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Additonally regard mailto:// as an empty URL, since Android does interpret them as such.
2023-10-20Treat empty mailto URIs properly under AndroidPo Lu1-0/+20
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): If an empty mailto: URI is supplied, ascertain if EXTRA_EMAIL is set, then derive a mailto URI from that if so.
2023-10-19Relay body and attachments within Android e-mails to message-mailtoPo Lu1-2/+114
* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Infer e-mail body and subject from its parameters and convey this information to message-mailto. * lisp/gnus/message.el (message-mailto): New arguments SUBJECT, BODY and FILE-ATTACHMENTS. (message-mailto-1): Insert these arguments as appropriate.
2023-10-15Correctly receive files through Android DNDPo Lu2-5/+93
* java/org/gnu/emacs/EmacsService.java (getUsefulContentResolver) (getContentResolverContext): New functions which return a content resolver from an EmacsActivity, if at all possible. (openContentUri, checkContentUri): Probe or open URIs through such content resolvers. Probe URIs by opening them if merely testing permissions fails, for DND URIs do not make checkCallingUriPermission return true. * java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Address potential crash. * src/androidvfs.c (android_check_content_access): Circumvent JNI dynamic method dispatch. (android_authority_name): Guarantee NAME is never a directory.
2023-10-14Implement multi-window drag-and-drop under AndroidPo Lu3-3/+160
* java/org/gnu/emacs/EmacsNative.java (sendDndDrag, sendDndUri) (sendDndText): Declare new event-sending functions. * java/org/gnu/emacs/EmacsView.java (onDragEvent): New function. * java/org/gnu/emacs/EmacsWindow.java (onDragEvent): New function; respond to each drag and drop event, request permissions if necessary and transfer dropped data to Lisp. * lisp/dnd.el (dnd-unescape-file-uris): New variable. (dnd-get-local-file-name): If that variable is nil, refrain from unescaping URLs provided. * lisp/term/android-win.el (android-handle-dnd-event): New function. (special-event-map): Bind drag-n-drop-event. * src/android.c (sendDndDrag, sendDndUri, sendDndText): New functions. * src/androidgui.h (enum android_event_type): New event types ANDROID_DND_DRAG_EVENT, ANDROID_DND_URI_EVENT, ANDROID_DND_TEXT_EVENT. (struct android_dnd_event): New structure. (union android_event) <dnd>: New field. * src/androidterm.c (handle_one_android_event) <ANDROID_DND_..._EVENT>: Generate drag-n-drop events for each of these types. (syms_of_androidterm) <Quri, Qtext>: New defsyms.
2023-10-13Clarify java/INSTALLPo Lu1-2/+4
* java/INSTALL: Correct erroneous include exports and also introduce those omitted within patches to external libraries. (bug#66507)
2023-10-10Implement frame restacking under AndroidPo Lu4-23/+171
* java/org/gnu/emacs/EmacsActivity.java (invalidateFocus1): Synchronize with window.children for iteration through it. * java/org/gnu/emacs/EmacsService.java (queryTree): Synchronize with windowList for iteration through it. * java/org/gnu/emacs/EmacsView.java (moveChildToBack): Correct formatting mistake. (moveAbove, moveBelow): New functions. * java/org/gnu/emacs/EmacsWindow.java (destroyHandle, reparentTo) (raise, lower): Remedy synchronization blunders. (reconfigure): New function. * src/android.c (android_init_emacs_window): Link with `reconfigure'. (android_reconfigure_wm_window): New wrapper function. * src/androidfns.c (android_frame_restack): New function. (Fandroid_frame_restack): Properly implement this function and expunge outdated comment. * src/androidgui.h (enum android_stack_mode) (enum android_window_changes): New enumerators.
2023-10-05Introduce an input method callback required by Android 34Po Lu2-0/+19
* java/org/gnu/emacs/EmacsInputConnection.java (replaceText): New function. * java/org/gnu/emacs/EmacsNative.java (replaceText): Declare native function. * src/androidgui.h (enum android_ime_operation): New operation ANDROID_IME_REPLACE_TEXT. * src/androidterm.c (android_handle_ime_event): Decode text when encountering an ANDROID_IME_REPLACE_TEXT operation. Return if decoding overflowed rather than presenting Qnil to textconv functions. (replaceText): New JNI function. * src/frame.h (enum text_conversion_operation): New operation TEXTCONV_REPLACE_TEXT. * src/textconv.c (really_commit_text): Move point to start if the composing region is set. (really_replace_text): New function. (handle_pending_conversion_events_1) <TEXTCONV_REPLACE_TEXT>: New case. (replace_text): New function. * src/textconv.h: Update prototypes.
2023-10-05Port Emacs to Android 34Po Lu4-7/+29
* configure.ac: Detect and require Android 34 headers. * doc/emacs/android.texi (Android Environment): Mention new permissions mandated by Android 34. * java/AndroidManifest.xml.in: Introduce new permissions and foreground service types prerequisite for background execution under Android 34. * java/INSTALL: Update installation documentation. * java/org/gnu/emacs/EmacsSdk7FontDriver.java (Sdk7FontEntity) (Sdk7FontObject): * java/org/gnu/emacs/EmacsService.java (onCreate): Silence deprecation warnings. * src/android.c: Update documentation.
2023-10-02Update Android portPo Lu2-1/+10
* java/AndroidManifest.xml.in: Exclude non-files from opening in Emacs. * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Avert crash should scheme be NULL.
2023-09-28Update Android portPo Lu1-4/+5
* doc/emacs/android.texi (Android Windowing): Document `android-keyboard-bell-duration'. * java/org/gnu/emacs/EmacsService.java (ringBell): New argument DURATION. * src/android.c (android_init_emacs_service): Adjust correspondingly. (android_bell): Provide the duration of the vibration. * src/androidfns.c (syms_of_androidfns) <android_keyboard_bell_duration>: New variable.
2023-09-25Update Android portPo Lu2-38/+32
* doc/lispref/os.texi (Desktop Notifications): Revise documentation for android-notifications-notify to reflect changes. * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Convert notification importance to a legacy priority between Android 7.1 and 4.1. * java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Remove immutable bitmap constructor, as the underlying Android API functions are erroneously implemented. * src/android.c (android_init_emacs_pixmap): Cease searching for deleted constructor. (android_create_pixmap_from_bitmap_data): Create a pixmap, then fill it with the contents of the bitmap, in lieu of employing the aforementioned constructor. * src/androidselect.c (Fandroid_notifications_notify): Revise doc string.
2023-09-24Update Android portPo Lu1-1/+1
* java/org/gnu/emacs/EmacsSdk11Clipboard.java (getClipboardData): Correct typo in comment. * src/androidvfs.c (android_authority_open) (android_saf_delete_document): Circumvent JNI dynamic method dispatch.
2023-09-23Display background dialogs using the correct stylePo Lu1-0/+8
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog): Wrap CONTEXT within EmacsStyle such that dialogs are displayed in the same style used by activities.
2023-09-22Enable opening mailto URLs under AndroidPo Lu2-23/+66
* doc/emacs/android.texi (Android Startup): Mention how mailto URLs are treated by the emacsclient wrapper. * java/AndroidManifest.xml.in: Register `mailto' scheme filters for EmacsOpenActivity. * java/org/gnu/emacs/EmacsOpenActivity.java (startEmacsClient): Extract code that starts Emacs when it isn't already running, and take a list of arguments rather than a single file name. (onCreate): If the scheme is `mailto', escape the URI and call `message-mailto'.
2023-09-18Optimize damage region tracking under AndroidPo Lu6-6/+31
* java/org/gnu/emacs/EmacsDrawLine.java (perform): * java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Call damageRect with integer coordinates in lieu of consing a new Rect. * java/org/gnu/emacs/EmacsDrawable.java (damageRect) <IIII>: Declare a new variant of damageRect, accepting four integers designating the extents of the damage rectangle. * java/org/gnu/emacs/EmacsPixmap.java (damageRect) <IIII>: New stub. * java/org/gnu/emacs/EmacsView.java (damageRect) <IIII>: Implement this overloaded variant of damageRect. * java/org/gnu/emacs/EmacsWindow.java (damageRect): Ditto. * src/android.c (android_init_emacs_drawable) (android_init_emacs_window): Move search for `damageRect' to android_init_emacs_window. (android_damage_window): Call IIII variant of `damageRect' to avoid consing a new rectangle. Ameliorate dynamic method dispatch overhead.
2023-09-16Update Android portPo Lu2-0/+14
* java/org/gnu/emacs/EmacsContextMenu.java (display): Return false if the list of menu buttons is empty, lest Android cease displaying menus on the assumption that Emacs is defective. * java/org/gnu/emacs/EmacsView.java (popupMenu): Likewise. * src/fns.c (sort_list): Render sentence motion commands functional within commentary * src/sfntfont.c (sfntfont_list_family): Sort and deduplicate the returned family list and make it a list of symbols. (syms_of_sfntfont) <Qstring_lessp>: New defsym.
2023-09-14Avert a crash in the Android last resort font driverPo Lu3-8/+29
* java/org/gnu/emacs/EmacsFontDriver.java (FONT_INVALID_CODE): New constant. (hasChar, encodeChar): Accept a jint character code rather than a jchar. * java/org/gnu/emacs/EmacsSdk23FontDriver.java (hasChar) (encodeChar): Return 0 or FONT_INVALID_CODE if the character is not representable in a Java char. * java/org/gnu/emacs/EmacsSdk7FontDriver.java (hasChar): Ditto. * src/androidfont.c (android_init_font_driver): Adjust signature to match.
2023-09-14Improve the Android last resort font driverPo Lu1-123/+71
* java/org/gnu/emacs/EmacsSdk7FontDriver.java (Sdk7Typeface): Rename fileName to familyName and cease attempting to infer a style from it. (EmacsSdk7FontDriver): Employ preset typefaces rather than enumerating each typeface within the system fonts directory. (draw): Circumvent kerning difficulties by advancing past each character individually.
2023-09-13Request additional permissions on AndroidPo Lu1-0/+2
* doc/emacs/android.texi (Android Environment): List two additional permissions within the summary of permissions granted by default. * java/AndroidManifest.xml.in: Request READ_CALENDAR and WRITE_CALENDAR.
2023-09-13Facilitate opening content:// files without a linked file namePo Lu1-8/+32
* java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy): If FILE is NULL, return a matching content URI if possible, else generate a file name with the URI as a reference. (onCreate): Catch SecurityException around calls to openFileDescriptor.
2023-09-06Properly run emacsclient under Android if DISPLAY is setPo Lu1-2/+6
* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Make dimensions final, since they are never changed after the constructor. * lib-src/emacsclient.c (decode_options): If --display is not provided, always set display to `android' even if DISPLAY is provided. * lisp/net/browse-url.el (browse-url): Cease setting DISPLAY under Android. * src/callproc.c (getenv_internal, make_environment_block): Don't afford DISPLAY special treatment under Android.
2023-09-04Correct deadlock in Android portPo Lu1-2/+2
* java/org/gnu/emacs/EmacsService.java (updateCursorAnchorInfo): Delete extraneous whitespace. (updateExtractedText): Encase synchronous IM manager operation in deadlock prevention mechanism.
2023-09-03Update Android portPo Lu1-5/+10
* java/org/gnu/emacs/EmacsService.java (browseUrl): Confer rights to write the URI indefinitely.
2023-09-03Move Android port internals documentation to admin/notesPo Lu1-1024/+3
* admin/notes/java: New file. Move most of its contents from README, and introduce a section on compatibility. * java/README: Move internals to admin/notes/java.
2023-09-02Open org-protocol:// links on AndroidPo Lu2-65/+14
* doc/emacs/android.texi (Android Startup): Revise to reflect changes in the set of files registered for Emacsclient and mention org-protocol support. * java/AndroidManifest.xml.in: Open all files, not just a particular subset of image and data files. Register an org-protocol scheme handler. * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Provide URI to Emacs verbatim if its scheme is `org-protocol'.
2023-08-30Facilitate typing `C-SPC' on AndroidPo Lu3-1/+25
* doc/emacs/android.texi (Android Windowing): Mention C-SPC interception and how it may be disabled. * java/org/gnu/emacs/EmacsNative.java (shouldForwardCtrlSpace): New function. * java/org/gnu/emacs/EmacsView.java (onKeyPreIme): New function. If the provided key code is SPC and the event's modifier key mask contains ControlMask, relay it directly to onKeyDown. * java/org/gnu/emacs/EmacsWindow.java (eventModifiers): Export and make static. * src/android.c (shouldForwardCtrlSpace): New function. * src/androidfns.c (syms_of_androidfns) <android_intercept_control_space>: New defvar.
2023-08-28Update Android portPo Lu6-76/+79
* java/org/gnu/emacs/EmacsActivity.java (attachWindow, onDestroy) (onWindowFocusChanged, onContextMenuClosed): * java/org/gnu/emacs/EmacsContextMenu.java (onMenuItemClick): * java/org/gnu/emacs/EmacsDialog.java (onClick, display1, onDismiss): * java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy) (onDestroy, onWindowFocusChanged, onPause): * java/org/gnu/emacs/EmacsWindowAttachmentManager.java (registerWindow, removeWindowConsumer, detachWindow) (noticeIconified, noticeDeiconified): Remove superfluous debugging code now that the Android port is stable. * java/org/gnu/emacs/EmacsView.java (onLayout): Detect if the IME is hidden while a toplevel window is focused, and clear isCurrentlyTextEditor in that case. (onApplyWindowInsets): New function. (raise, lower, popupMenu, onCreateInputConnection): Delete aforementioned debugging code.
2023-08-27Update Android portPo Lu1-2/+8
* java/org/gnu/emacs/EmacsView.java (onLayout): Provide for occasions where the saved measured dimensions differ from that saved by the view.
2023-08-24Install rcs2log within Emacs packages for AndroidPo Lu1-0/+7
* doc/emacs/android.texi (Android Environment): Mention the `rcs2log' program name variable. Also refine the wording of the paragraph describing bundled programs a bit. * doc/lispref/processes.texi (Subprocess Creation): Mention `rcs2log' and `rcs2log-program-name'. Correct typos and spelling mistakes within the variable index. * etc/NEWS: Amend the announcement of *-program-name to also cite rcs2log. * java/Makefile.in (install_temp): Copy rcs2log to lib/*/librcs2log.so after minor revisions to change the interpreter name. * lisp/vc/vc-rcs.el (vc-rcs-rcs2log-program): Ground the program name upon `rcs2log-program-name'. * src/callproc.c (syms_of_callproc) <Vrcs2log_program_name>: New defvar. Define to `librcs2log.so' under Android, `rcs2log' elsewhere.
2023-08-22Take precautions against NULL returns from getPrimaryClipPo Lu1-11/+5
* java/org/gnu/emacs/EmacsSdk11Clipboard.java (getClipboardData): Return null if the clip data is not set. Also delete superfluous debugging code. (bug#65445) (getClipboard): Don't dereference NULL clip data.
2023-08-21; Fix issues running gitmergeJim Porter1-1/+0
* .gitattributes: Ignore whitespace issues in java/INSTALL. * build-aux/git-hooks/pre-commit (git_diff): Explicitly allow "ChangeLog.android". * java/README: Remove extra trailing newline.
2023-08-22Improve Android adaptive iconPo Lu2-17/+3
* java/res/drawable/emacs_background.xml: Delete trailing whitespace and modify gradient offset to match emacs.svg. * java/res/drawable/emacs_foreground.xml: Delete trailing whitespace and remove redundant path.
2023-08-22Repair desktop notification on Android 31Po Lu1-1/+1
* java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Provide FLAG_IMMUTABLE under Android S and later, not just versions of Android after S. (bug#65433)