]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix crash on old versions of Android
authorPo Lu <luangruo@yahoo.com>
Fri, 17 Feb 2023 11:02:23 +0000 (19:02 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 17 Feb 2023 11:02:23 +0000 (19:02 +0800)
* java/org/gnu/emacs/EmacsService.java (nameKeysym): Implement
stub on Android 3.0 and earlier.

java/org/gnu/emacs/EmacsService.java

index 4d373937ab0fa31160d2da2b18066b45d270a8b2..ba6ec485d62c6f4fdae20aa9a7d9549e75063ef4 100644 (file)
@@ -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