Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8097043

[Android] key mapping overflow

    XMLWordPrintable

Details

    Description

      bug in to_linux_keycode: the total occupation of a map is considered as the size (#elements).
      The following patch fixes this:
      diff -r 73e79f23096b modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c
      --- a/modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c Sun Jun 29 14:37:50 2014 +0300
      +++ b/modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c Mon Jun 30 15:57:49 2014 +0200
      @@ -63,7 +63,8 @@
       }
       
       int to_linux_keycode(int androidKeyCode) {
      - for (int i = 0; i < sizeof (keyMap); ++i) {
      + int keySize = sizeof(keyMap)/sizeof(keyMap[0]);
      + for (int i = 0; i < keySize; ++i) {
               if (keyMap[i].androidKC == androidKeyCode) {
                   return keyMap[i].linuxKC;
               }

      Attachments

        Activity

          People

            ddhill David Hill (Inactive)
            jvos Johan Vos
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: