From bd1cc1da005fe477bf28afce43d5572e381b4757 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Wed, 15 Sep 2010 18:14:07 +0900
Subject: [PATCH] Fix bug that upper case mini-keyboard does not work

This issue is introduced by I1932b0a382e172cb77b9e098ae182049c834dfe0

Bug: 2993769
Change-Id: I344d21e046b58b3bb9831605a7425a94c97d8492
---
 .../inputmethod/latin/MiniKeyboardKeyDetector.java     | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/java/src/com/android/inputmethod/latin/MiniKeyboardKeyDetector.java b/java/src/com/android/inputmethod/latin/MiniKeyboardKeyDetector.java
index 709d082bed..356e62d482 100644
--- a/java/src/com/android/inputmethod/latin/MiniKeyboardKeyDetector.java
+++ b/java/src/com/android/inputmethod/latin/MiniKeyboardKeyDetector.java
@@ -41,19 +41,19 @@ class MiniKeyboardKeyDetector extends KeyDetector {
         final Key[] keys = getKeys();
         final int touchX = getTouchX(x);
         final int touchY = getTouchY(y);
-        int closestKey = LatinKeyboardBaseView.NOT_A_KEY;
+        int closestKeyIndex = LatinKeyboardBaseView.NOT_A_KEY;
         int closestKeyDist = (y < 0) ? mSlideAllowanceSquareTop : mSlideAllowanceSquare;
         final int keyCount = keys.length;
         for (int i = 0; i < keyCount; i++) {
             final Key key = keys[i];
             int dist = key.squaredDistanceFrom(touchX, touchY);
             if (dist < closestKeyDist) {
-                closestKey = i;
+                closestKeyIndex = i;
                 closestKeyDist = dist;
             }
         }
-        if (allKeys != null && closestKey != LatinKeyboardBaseView.NOT_A_KEY)
-            allKeys[0] = closestKey;
-        return closestKey;
+        if (allKeys != null && closestKeyIndex != LatinKeyboardBaseView.NOT_A_KEY)
+            allKeys[0] = keys[closestKeyIndex].codes[0];
+        return closestKeyIndex;
     }
 }
-- 
GitLab