From: Po Lu Date: Fri, 17 Feb 2023 11:02:23 +0000 (+0800) Subject: Fix crash on old versions of Android X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=60ed861b10fdc34bb9c888a59c6e6f75a27b77b4;p=emacs.git Fix crash on old versions of Android * java/org/gnu/emacs/EmacsService.java (nameKeysym): Implement stub on Android 3.0 and earlier. --- 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