diff options
| author | Po Lu | 2023-11-18 14:15:55 +0800 |
|---|---|---|
| committer | Po Lu | 2023-11-18 14:15:55 +0800 |
| commit | 669e754f5bdc9f9130a68eec6966babe9a85ecae (patch) | |
| tree | 718d7fe3517a79ae69ed3380cd86e0f8c4716621 /src/android.h | |
| parent | 05213345c04d4572afec46b99a58d206a111c846 (diff) | |
| download | emacs-669e754f5bdc9f9130a68eec6966babe9a85ecae.tar.gz emacs-669e754f5bdc9f9130a68eec6966babe9a85ecae.zip | |
Offer to grant storage permissions if absent
* 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.
Diffstat (limited to 'src/android.h')
| -rw-r--r-- | src/android.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/android.h b/src/android.h index 28d9d25930e..12f9472836f 100644 --- a/src/android.h +++ b/src/android.h | |||
| @@ -123,6 +123,8 @@ extern void android_wait_event (void); | |||
| 123 | extern void android_toggle_on_screen_keyboard (android_window, bool); | 123 | extern void android_toggle_on_screen_keyboard (android_window, bool); |
| 124 | extern _Noreturn void android_restart_emacs (void); | 124 | extern _Noreturn void android_restart_emacs (void); |
| 125 | extern int android_request_directory_access (void); | 125 | extern int android_request_directory_access (void); |
| 126 | extern bool android_external_storage_available_p (void); | ||
| 127 | extern void android_request_storage_access (void); | ||
| 126 | extern int android_get_current_api_level (void) | 128 | extern int android_get_current_api_level (void) |
| 127 | __attribute__ ((pure)); | 129 | __attribute__ ((pure)); |
| 128 | 130 | ||
| @@ -289,6 +291,8 @@ struct android_emacs_service | |||
| 289 | jmethodID rename_document; | 291 | jmethodID rename_document; |
| 290 | jmethodID move_document; | 292 | jmethodID move_document; |
| 291 | jmethodID valid_authority; | 293 | jmethodID valid_authority; |
| 294 | jmethodID external_storage_available; | ||
| 295 | jmethodID request_storage_access; | ||
| 292 | }; | 296 | }; |
| 293 | 297 | ||
| 294 | extern JNIEnv *android_java_env; | 298 | extern JNIEnv *android_java_env; |