From 9a2039d94e009dd83cc7894ec0ccea7f181ad355 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Tue, 12 Feb 2013 14:51:54 +0900
Subject: [PATCH] Fix RTL language key code mapping

Bug: 8168899
Bug: 8169343
Change-Id: I23120704e97d89d5ddec2b2bdff2a98a6daac4d5
---
 .../inputmethod/keyboard/internal/KeyboardCodesSet.java      | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java
index 6ad9d286f..0ec6b0176 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java
@@ -74,6 +74,7 @@ public final class KeyboardCodesSet {
     private static final int CODE_LEFT_CURLY_BRACKET = '{';
     private static final int CODE_RIGHT_CURLY_BRACKET = '}';
 
+    // This array should be aligned with the array RTL below.
     private static final int[] DEFAULT = {
         Constants.CODE_TAB,
         Constants.CODE_ENTER,
@@ -117,6 +118,7 @@ public final class KeyboardCodesSet {
         DEFAULT[12],
         DEFAULT[13],
         DEFAULT[14],
+        DEFAULT[15],
         CODE_RIGHT_PARENTHESIS,
         CODE_LEFT_PARENTHESIS,
         CODE_GREATER_THAN_SIGN,
@@ -140,6 +142,9 @@ public final class KeyboardCodesSet {
     };
 
     static {
+        if (DEFAULT.length != RTL.length) {
+            throw new RuntimeException("Internal inconsistency");
+        }
         for (int i = 0; i < ID_TO_NAME.length; i++) {
             sNameToIdMap.put(ID_TO_NAME[i], i);
         }