From 60ed861b10fdc34bb9c888a59c6e6f75a27b77b4 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 17 Feb 2023 19:02:23 +0800 Subject: [PATCH] Fix crash on old versions of Android * java/org/gnu/emacs/EmacsService.java (nameKeysym): Implement stub on Android 3.0 and earlier. --- java/org/gnu/emacs/EmacsService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 4d373937ab0..ba6ec485d62 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java @@ -470,7 +470,10 @@ public class EmacsService extends Service public String nameKeysym (int keysym) { - return KeyEvent.keyCodeToString (keysym); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) + return KeyEvent.keyCodeToString (keysym); + + return String.valueOf (keysym); } public void -- 2.39.5