aboutsummaryrefslogtreecommitdiffstats
path: root/java (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Update Android portPo Lu2023-09-162-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.
* Avert a crash in the Android last resort font driverPo Lu2023-09-143-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.
* Improve the Android last resort font driverPo Lu2023-09-141-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.
* Request additional permissions on AndroidPo Lu2023-09-131-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.
* Facilitate opening content:// files without a linked file namePo Lu2023-09-131-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.
* Properly run emacsclient under Android if DISPLAY is setPo Lu2023-09-061-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.
* Correct deadlock in Android portPo Lu2023-09-041-2/+2
| | | | | | | * java/org/gnu/emacs/EmacsService.java (updateCursorAnchorInfo): Delete extraneous whitespace. (updateExtractedText): Encase synchronous IM manager operation in deadlock prevention mechanism.
* Update Android portPo Lu2023-09-031-5/+10
| | | | | * java/org/gnu/emacs/EmacsService.java (browseUrl): Confer rights to write the URI indefinitely.
* Move Android port internals documentation to admin/notesPo Lu2023-09-031-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.
* Open org-protocol:// links on AndroidPo Lu2023-09-022-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'.
* Facilitate typing `C-SPC' on AndroidPo Lu2023-08-303-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.
* Update Android portPo Lu2023-08-286-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.
* Update Android portPo Lu2023-08-271-2/+8
| | | | | | * java/org/gnu/emacs/EmacsView.java (onLayout): Provide for occasions where the saved measured dimensions differ from that saved by the view.
* Install rcs2log within Emacs packages for AndroidPo Lu2023-08-241-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.
* Take precautions against NULL returns from getPrimaryClipPo Lu2023-08-221-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.
* ; Fix issues running gitmergeJim Porter2023-08-211-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.
* Improve Android adaptive iconPo Lu2023-08-222-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.
* Repair desktop notification on Android 31Po Lu2023-08-221-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)
* Make the Emacs icon ``adaptive''Po Lu2023-08-216-2/+120
| | | | | | | | | | | | | | | | | * java/AndroidManifest.xml.in (EmacsApplication): Set icon to @mipmap/emacs_icon. * java/org/gnu/emacs/EmacsService.java (onStartCommand): Pick a better name for the persistent notification channel. * java/res/drawable/emacs_background.xml: * java/res/drawable/emacs_foreground.xml: * java/res/mipmap/emacs_icon.png: * java/res/mipmap-v26/emacs_icon.xml: New files, comprising an ``adaptive icon'' required by some Android launchers.
* Enable providing icons for Android desktop notificationsPo Lu2023-08-212-11/+24
| | | | | | | | | | | | | | | | | | | | | | * doc/lispref/os.texi (Desktop Notifications) <android-notifications-notify>: Mention the :icon parameter. * java/org/gnu/emacs/EmacsDesktopNotification.java (EmacsDesktopNotification) <icon>: New field. (<init>): New argument ICON. Set this.icon to its value. (display1): Use provided icon and always supply a pending intent to open Emacs once the notification is clicked. * java/res/layout/sdk8_notifications_view.xml (sdk8_notifications_title, sdk8_notifications_content): Set foreground color to #000000. * src/androidselect.c (android_init_emacs_desktop_notification): Update signature of <init>. (android_locate_icon): New function. (android_notifications_notify_1): New arg ICON. (Fandroid_notifications_notify): New parameter icon. (syms_of_androidselect): <QCicon>: New symbol.
* Repair desktop notification display on Android 2.3 and 2.2Po Lu2023-08-201-0/+12
| | | | | | * java/org/gnu/emacs/EmacsDesktopNotification.java (display1): Create a pending intent and set it as the contentIntent when building a notification by hand.
* Support desktop notifications on AndroidPo Lu2023-08-204-1/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/android.texi (Android Environment): Correct list of permissions granted by default. * doc/lispref/os.texi (Desktop Notifications): Document the new function `android-notifications-notify' and its limitations. * java/AndroidManifest.xml.in: Request notification permissions. * java/org/gnu/emacs/EmacsDesktopNotification.java: New file. * java/res/layout/sdk8_notifications_view.xml: New file holding substitute notification widget definitions for Android versions prior to 3.0. * java/res/values/strings.xml: Remove inadvertently introduced tag attribute. * lisp/org/org-clock.el (haiku-notifications-notify): Correct file name in function declaration. (android-notifications-notify): New declaration. (org-show-notification): Use `android-notifications-notify'. * src/androidselect.c (android_init_emacs_desktop_notification) (android_notifications_notify_1, Fandroid_notifications_notify): New functions. (init_androidselect, syms_of_androidselect): Initialize new class and define new subr.
* Fix potential NULL pointer dereferencePo Lu2023-08-171-0/+1
| | | | | * java/org/gnu/emacs/EmacsDialog.java (display): Initialize rc.thing to false.
* Improve efficiency of checking for access to authority documentsPo Lu2023-08-141-30/+16
| | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsService.java (checkContentUri): Take a string instead of a byte array. Then, use checkCallingUriPermission, in lieu of opening the file. * src/android.c (android_check_content_access): Delete unused function. (android_init_emacs_service): Adjust for changes to checkContentUri's signature. * src/androidvfs.c (android_get_content_name): Return the file name in a new buffer. (android_check_content_access): Adjust correspondingly. (android_authority_name): Verify NAME is a valid JNI string.
* Merge from origin/emacs-29Eli Zaretskii2023-08-121-1/+1
| | | | | | | | | | | | | | | | 4767f5eaeed Better fix for bug#65156 dd1d8414b33 Fix insert-file-contents with pipes and /dev/stdin 50649a6d1a2 ; * etc/PROBLEMS: Fix wording. f0dda682ffb ; * etc/NEWS.28: Add deletion of levents.el. f4acae842c0 Fix bug#65042 e1874c4e8bf * configure.ac (HAVE_TREE_SITTER): Set NEED_DYNLIB=yes (b... ef8838c3a5f * etc/NEWS: Mention tramp-show-ad-hoc-proxies. 495bee253fc * test/lisp/net/tramp-tests.el (tramp-test42-utf8): Skip ... de1effd73b4 ; Fix last change 7c7966862bc * test/lisp/net/tramp-tests.el (tramp-test10-write-region... 16205e8db65 ; Improve help-echo in package.el a95e7006989 ; Filter packages available for upgrade via menu bar adff72dd1d2 Fix reverting Rmail buffers
* ; Fix typoStefan Kangas2023-08-121-1/+1
|
* ; * java/INSTALL (LOCATING NECESSARY FILES): New section.Po Lu2023-08-121-2/+52
|
* Minor adjustments to Android portPo Lu2023-08-111-2/+6
| | | | | | | | * java/org/gnu/emacs/EmacsService.java (readDirectoryEntry): Also refrain from returning NULL or file names containing non-representable NULL bytes. * src/callproc.c (get_current_directory): Clean up by employing android_is_special_directory.
* ; Improve INSTALL filesEli Zaretskii2023-08-091-2/+3
| | | | | * INSTALL: * java/INSTALL: Improve and clarify instructions.
* Avoid caching file status when they are about to changePo Lu2023-08-082-10/+22
| | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (EmacsSafThread) (cacheFileStatus): New argument NO_CACHE. (cacheDirectoryFromCursor, statDocument1): * java/org/gnu/emacs/EmacsService.java (EmacsService) (statDocument): Plumb that argument through each of these wrapper functions. * src/android.c (android_init_emacs_service): Adjust JNI function signatures to agree with statDocument1. * src/androidvfs.c (android_saf_stat): Plumb that argument through here. (android_saf_tree_stat, android_saf_file_open): And don't cache file status if a write is imminent.
* Fix truncation for the Android internal storage providerPo Lu2023-08-081-2/+7
| | | | | | * java/org/gnu/emacs/EmacsSafThread.java (openDocument1): If truncate is specified while resorting to `w', try truncating the file by hand.
* Utilize more frequently supported file access modesPo Lu2023-08-082-35/+43
| | | | | | | | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (openDocument1): Use plain r or w where possible, as the fileio stuff is now better prepared for FIFOs. (openDocument): New argument READ. * java/org/gnu/emacs/EmacsService.java (openDocument): New argument READ. * src/android.c (android_init_emacs_service): Adjust correspondingly. * src/androidvfs.c (android_saf_file_open): Don't support O_APPEND. Pass read as well as trunc and write.
* Update Android portPo Lu2023-08-061-1/+2
| | | | | * java/org/gnu/emacs/EmacsService.java (readDirectoryEntry): Fix potential NULL dereference.
* Update Android portPo Lu2023-08-062-0/+41
| | | | | | | | | | | | * java/org/gnu/emacs/EmacsNative.java: Declare ftruncate. * java/org/gnu/emacs/EmacsSafThread.java (openDocument1): If initially opening with rwt, verify the file descriptor is really writable; if not, resort to rw and truncating the file descriptor by hand instead. * src/androidvfs.c (NATIVE_NAME (ftruncate)): New function. Truncate file descriptor and return whether that was successful.
* Avoid encoding commonplace characters in tree namesPo Lu2023-08-041-2/+6
| | | | | | * java/org/gnu/emacs/EmacsService.java (getDocumentTrees): Don't encode some characters that need not be escaped within file names.
* Update Android portPo Lu2023-08-032-112/+252
| | | | | | | | | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (CacheToplevel): (EmacsSafThread): (DocIdEntry): (getCache): (pruneCache): (cacheDirectoryFromCursor): (run): (documentIdFromName1): (statDocument1): (openDocumentDirectory1): (openDocument1): Introduce a file status cache and populate it with files within directories as they are opened. * java/org/gnu/emacs/EmacsService.java (createDocument): (createDirectory): (moveDocument): Invalidate the file status cache wherever needed. * src/fileio.c (check_vfs_filename): (Fset_file_modes): Permit `set-file-modes' to silently fail on asset and content files.
* Fix reporting of key events containing SYM and METAPo Lu2023-08-021-6/+12
| | | | | | | | | | | | | | | | * doc/emacs/android.texi (Android)::(What is Android?): (Android Startup, Android File System, Android Environment) (Android Windowing, Android Fonts, Android Troubleshooting): Improve section titles. (Android Windowing): Describe the relation between keyboard modifiers reported by Android and those in key events. * java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp): Clear META_SYM_ON and META_META_MASK when retrieving ASCII characters. * src/androidgui.h: Add ANDROID_META_MASK. * src/androidterm.c (android_android_to_emacs_modifiers) (android_emacs_to_android_modifiers): Transform META to Alt, and vice versa.
* Update Android portPo Lu2023-08-011-0/+25
| | | | | | | | | | | | | | * doc/emacs/android.texi (Android File System): Describe how to access real files named /assets or /contents if so required. * java/org/gnu/emacs/EmacsService.java (validAuthority): * src/android.c (android_init_emacs_service): * src/android.h: New function. * src/androidvfs.c (android_saf_valid_authority_p): New function. Wrap the Java function. (android_saf_root_stat, android_saf_root_access): Don't return success if no authority by vp->authority's name exists. (android_saf_tree_from_name): Check validity of string data before giving it to JNI.
* Initialize Android API level earlierPo Lu2023-07-314-14/+13
| | | | | | | | | | * java/org/gnu/emacs/EmacsNative.java (EmacsNative): * java/org/gnu/emacs/EmacsNoninteractive.java (main): * java/org/gnu/emacs/EmacsService.java (run): * java/org/gnu/emacs/EmacsThread.java (run): * src/android.c (initEmacs, setEmacsParams): Set `android_api_level' within setEmacsParams, not in initEmacs. * src/androidvfs.c: Pacify compiler warnings.
* Implement cross-directory SAF rename operationsPo Lu2023-07-311-17/+50
| | | | | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsService.java (renameDocument): Don't catch UnsupportedOperationException; handle ENOSYS in android_saf_rename_document instead. (moveDocument): New function. * lisp/subr.el (y-or-n-p): Always change the text conversion style. * src/android.c (android_init_emacs_service) (android_exception_check_4): New function. * src/android.h: Update Java function table. * src/androidvfs.c (android_saf_rename_document): Handle ENOSYS here by setting errno to EXDEV. (android_saf_move_document): New function. (android_document_id_from_name): Take const `dir_name'. (android_saf_tree_rename): Use delete-move-rename to implement cross-directory renames.
* Partially implement rename operations on SAF filesPo Lu2023-07-302-2/+113
| | | | | | | | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (postInvalidateCacheDir): * java/org/gnu/emacs/EmacsService.java (renameDocument): New functions. * src/android.c (android_init_emacs_service): * src/android.h (struct android_emacs_service): Link to new JNI function. * src/androidvfs.c (android_saf_rename_document): New function. (android_saf_tree_rename): Implement in terms of that function if possible.
* Correct directory permissions reported for VFS filesPo Lu2023-07-291-27/+32
| | | | | | * java/org/gnu/emacs/EmacsSafThread.java (statDocument1): * src/androidvfs.c (android_afs_stat, android_content_stat) (android_saf_root_stat): Report search permissions for files.
* Update Android portPo Lu2023-07-292-9/+71
| | | | | | | | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (postInvalidateCache): New argument cacheName. Remove that file from the cache. (accessDocument1): Consult the storage cache as well. * java/org/gnu/emacs/EmacsService.java (deleteDocument): New argument NAME. * src/android.c (android_init_emacs_service): Add new argument. * src/androidvfs.c (android_saf_delete_document) (android_saf_tree_rmdir, android_saf_file_unlink): Pass name of file being deleted to `deleteDocument'.
* Update Android portPo Lu2023-07-291-7/+18
| | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry): (getCacheEntry): (CacheEntry): (documentIdFromName1): Fix earlier change.
* Update Android portPo Lu2023-07-291-8/+5
| | | | | | * java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry) (getCacheEntry, CacheEntry): Use `uptimeMillis' as the basis for cache expiration.
* Update Android portPo Lu2023-07-292-67/+531
| | | | | | | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (EmacsSafThread, getCache) (pruneCache1, pruneCache, cacheChild, cacheDirectoryFromCursor) (documentIdFromName1, openDocumentDirectory1): Implement the cache referred to by the commentary. * java/org/gnu/emacs/EmacsService.java (deleteDocument): Invalidate the cache upon document removal. * src/androidvfs.c (android_saf_exception_check) (android_document_id_from_name): Correctly preserve or set errno in error cases.
* Fix SAF queryPo Lu2023-07-281-1/+1
| | | | | * java/org/gnu/emacs/EmacsSafThread.java (documentIdFromName1): Fix query argument placeholder string.
* Allow quitting from Android content provider operationsPo Lu2023-07-283-473/+986
| | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/android.texi (Android Document Providers): Say that quitting is now possible. * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New functions `safSyncAndReadInput', `safync' and `safPostRequest'. * java/org/gnu/emacs/EmacsSafThread.java: New file. Move cancel-able SAF operations here. * java/org/gnu/emacs/EmacsService.java (EmacsService): Allow quitting from most SAF operations. * src/androidvfs.c (android_saf_exception_check): Return EINTR if OperationCanceledException is received. (android_saf_stat, android_saf_access) (android_document_id_from_name, android_saf_tree_opendir_1) (android_saf_file_open): Don't allow reentrant calls from async input handlers. (NATIVE_NAME): Implement new synchronization primitives for JNI. (android_vfs_init): Initialize new class. * src/dired.c (open_directory): Handle EINTR from opendir. * src/sysdep.c: Describe which operations may return EINTR on Android.
* Update Android portPo Lu2023-07-282-93/+119
| | | | | | | | | | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsDirectoryEntry.java (EmacsDirectoryEntry): Make class final. * java/org/gnu/emacs/EmacsService.java (accessDocument) (openDocumentDirectory, openDocument, createDocument): Throw access and IO error exceptions instead of catching them. (createDirectory, deleteDocument): New functions. * src/android.c (android_init_emacs_service): Add new functions. * src/android.h (struct android_emacs_service): Likewise. * src/androidvfs.c (android_saf_exception_check): New function. Translate between Java exceptions and errno values. (android_saf_stat, android_saf_access, android_saf_delete_document) (struct android_saf_tree_vnode, android_document_id_from_name) (android_saf_tree_name, android_saf_tree_rmdir) (android_saf_tree_opendir_1, android_saf_tree_opendir) (android_saf_file_open, android_saf_file_unlink) (android_saf_new_open, android_saf_new_mkdir): Implement missing VFS operations and derive errno values from the type of any exceptions thrown. (android_vfs_init): Initialize exception classes. (android_mkdir, android_fstat): Remove trailing whitespace.
* Update Android portPo Lu2023-07-271-28/+6
| | | | | | | | | | | | | | | * doc/emacs/android.texi (Android Document Providers): Improve wording of paragraph clarifying limits on subprocesses. * java/org/gnu/emacs/EmacsService.java (getDocumentTrees): Use Java standard US-ASCII coding standard instead of the undocumented ``ASCII'' alias. (decodeFileName): Remove unused function. (documentIdFromName): * src/android.c (android_init_emacs_service): Take a String for NAME instead of a byte array. * src/androidvfs.c (android_verify_jni_string): New function. (android_document_id_from_name): Verify that STRING is a valid Modified UTF-8 string.