diff options
| author | Po Lu | 2024-02-06 13:10:57 +0800 |
|---|---|---|
| committer | Po Lu | 2024-02-06 17:53:23 +0800 |
| commit | 0d2b7120783255fbb0f8e98717573c35425f4df6 (patch) | |
| tree | 3b6ecfe6ffaabc458e49ca69bafdae042bef5137 /java | |
| parent | cebd26b2e16d75a939e2a9f91becc6ec702122a7 (diff) | |
| download | emacs-0d2b7120783255fbb0f8e98717573c35425f4df6.tar.gz emacs-0d2b7120783255fbb0f8e98717573c35425f4df6.zip | |
Don't forcibly display dialogs on Android if a keyboard is present
* 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.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsService.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 5cb1ceca0aa..93e34e6e694 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java | |||
| @@ -60,6 +60,7 @@ import android.content.UriPermission; | |||
| 60 | import android.content.pm.PackageManager; | 60 | import android.content.pm.PackageManager; |
| 61 | 61 | ||
| 62 | import android.content.res.AssetManager; | 62 | import android.content.res.AssetManager; |
| 63 | import android.content.res.Configuration; | ||
| 63 | 64 | ||
| 64 | import android.hardware.input.InputManager; | 65 | import android.hardware.input.InputManager; |
| 65 | 66 | ||
| @@ -581,6 +582,15 @@ public final class EmacsService extends Service | |||
| 581 | return false; | 582 | return false; |
| 582 | } | 583 | } |
| 583 | 584 | ||
| 585 | public boolean | ||
| 586 | detectKeyboard () | ||
| 587 | { | ||
| 588 | Configuration configuration; | ||
| 589 | |||
| 590 | configuration = getResources ().getConfiguration (); | ||
| 591 | return configuration.keyboard != Configuration.KEYBOARD_NOKEYS; | ||
| 592 | } | ||
| 593 | |||
| 584 | public String | 594 | public String |
| 585 | nameKeysym (int keysym) | 595 | nameKeysym (int keysym) |
| 586 | { | 596 | { |