From d9c52ba62317aa7919483ccd157182ae0f0db7f4 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Fri, 18 Feb 2011 14:16:29 +0900
Subject: [PATCH] Rename imeOptions attribute of Keyboard to imeAction.

Bug: 3384942
Change-Id: I3ce01b83f0ae37f447de8a7fcdb5d7fe06b108c6
---
 java/res/values/attrs.xml                           |  2 +-
 java/res/xml-xlarge/kbd_qwerty_row4.xml             |  2 +-
 java/res/xml/kbd_key_styles.xml                     | 10 +++++-----
 .../android/inputmethod/keyboard/KeyboardId.java    | 13 +++++++------
 .../inputmethod/keyboard/KeyboardParser.java        | 13 +++++++------
 5 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index b6d5fdc626..dea1635955 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -171,7 +171,7 @@
         <attr name="hasSettingsKey" format="string" />
         <attr name="voiceKeyEnabled" format="string" />
         <attr name="hasVoiceKey" format="string" />
-        <attr name="imeOptions">
+        <attr name="imeAction">
             <!-- This should be aligned with EditorInfo.IME_ACTION_* -->
             <flag name="actionUnspecified" value="0" />
             <flag name="actionNone" value="1" />
diff --git a/java/res/xml-xlarge/kbd_qwerty_row4.xml b/java/res/xml-xlarge/kbd_qwerty_row4.xml
index 9d0fd81c72..65ca093a47 100644
--- a/java/res/xml-xlarge/kbd_qwerty_row4.xml
+++ b/java/res/xml-xlarge/kbd_qwerty_row4.xml
@@ -49,7 +49,7 @@
             <default>
                 <switch>
                     <case
-                        latin:imeOptions="actionSearch"
+                        latin:imeAction="actionSearch"
                     >
                         <Key
                             latin:keyLabel=":"
diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml
index 3b35f35609..473510ec4b 100644
--- a/java/res/xml/kbd_key_styles.xml
+++ b/java/res/xml/kbd_key_styles.xml
@@ -182,7 +182,7 @@
     <!-- Return key style -->
     <switch>
         <case
-            latin:imeOptions="actionGo"
+            latin:imeAction="actionGo"
         >
             <key-style
                 latin:styleName="returnKeyStyle"
@@ -191,7 +191,7 @@
                 latin:parentStyle="functionalKeyStyle" />
         </case>
         <case
-            latin:imeOptions="actionNext"
+            latin:imeAction="actionNext"
         >
             <key-style
                 latin:styleName="returnKeyStyle"
@@ -200,7 +200,7 @@
                 latin:parentStyle="functionalKeyStyle" />
         </case>
         <case
-            latin:imeOptions="actionDone"
+            latin:imeAction="actionDone"
         >
             <key-style
                 latin:styleName="returnKeyStyle"
@@ -209,7 +209,7 @@
                 latin:parentStyle="functionalKeyStyle" />
         </case>
         <case
-            latin:imeOptions="actionSend"
+            latin:imeAction="actionSend"
         >
             <key-style
                 latin:styleName="returnKeyStyle"
@@ -218,7 +218,7 @@
                 latin:parentStyle="functionalKeyStyle" />
         </case>
         <case
-            latin:imeOptions="actionSearch"
+            latin:imeAction="actionSearch"
         >
             <switch>
                 <case
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
index db86740c38..42dc0b0cd2 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
@@ -44,7 +44,7 @@ public class KeyboardId {
     public final boolean mHasSettingsKey;
     public final boolean mVoiceKeyEnabled;
     public final boolean mHasVoiceKey;
-    public final int mImeOptions;
+    public final int mImeAction;
     public final boolean mEnableShiftLock;
     public final String mXmlName;
 
@@ -61,8 +61,9 @@ public class KeyboardId {
         this.mHasSettingsKey = hasSettingsKey;
         this.mVoiceKeyEnabled = voiceKeyEnabled;
         this.mHasVoiceKey = hasVoiceKey;
-        // We are interested only in IME_MASK_ACTION enum value and IME_FLAG_NO_ENTER_ACTION.
-        this.mImeOptions = imeOptions
+        // We are interested only in {@link EditorInfo#IME_MASK_ACTION} enum value and
+        // {@link EditorInfo#IME_FLAG_NO_ENTER_ACTION}.
+        this.mImeAction = imeOptions
                 & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
         this.mEnableShiftLock = enableShiftLock;
         this.mXmlName = xmlName;
@@ -76,7 +77,7 @@ public class KeyboardId {
                 hasSettingsKey,
                 voiceKeyEnabled,
                 hasVoiceKey,
-                imeOptions,
+                mImeAction,
                 enableShiftLock,
         });
     }
@@ -115,7 +116,7 @@ public class KeyboardId {
             && other.mHasSettingsKey == this.mHasSettingsKey
             && other.mVoiceKeyEnabled == this.mVoiceKeyEnabled
             && other.mHasVoiceKey == this.mHasVoiceKey
-            && other.mImeOptions == this.mImeOptions
+            && other.mImeAction == this.mImeAction
             && other.mEnableShiftLock == this.mEnableShiftLock;
     }
 
@@ -131,7 +132,7 @@ public class KeyboardId {
                 mLocale,
                 (mOrientation == 1 ? "port" : "land"),
                 modeName(mMode),
-                imeOptionsName(mImeOptions),
+                imeOptionsName(mImeAction),
                 colorSchemeName(mColorScheme),
                 (mHasSettingsKey ? " hasSettingsKey" : ""),
                 (mVoiceKeyEnabled ? " voiceKeyEnabled" : ""),
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
index e8324e5fd1..1aec686e0f 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
@@ -427,13 +427,14 @@ public class KeyboardParser {
                     R.styleable.Keyboard_Case_hasVoiceKey, id.mHasVoiceKey);
             final boolean colorSchemeMatched = matchInteger(viewAttr,
                     R.styleable.KeyboardView_colorScheme, id.mColorScheme);
-            // As noted at KeyboardSwitcher.KeyboardId class, we are interested only in
-            // enum value masked by IME_MASK_ACTION and IME_FLAG_NO_ENTER_ACTION. So matching
+            // As noted at {@link KeyboardId} class, we are interested only in enum value masked by
+            // {@link android.view.inputmethod.EditorInfo#IME_MASK_ACTION} and
+            // {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_ENTER_ACTION}. So matching
             // this attribute with id.mImeOptions as integer value is enough for our purpose.
-            final boolean imeOptionsMatched = matchInteger(a,
-                    R.styleable.Keyboard_Case_imeOptions, id.mImeOptions);
+            final boolean imeActionMatched = matchInteger(a,
+                    R.styleable.Keyboard_Case_imeAction, id.mImeAction);
             final boolean selected = modeMatched && settingsKeyMatched && voiceEnabledMatched
-                    && voiceKeyMatched && colorSchemeMatched && imeOptionsMatched;
+                    && voiceKeyMatched && colorSchemeMatched && imeActionMatched;
 
             if (DEBUG) Log.d(TAG, String.format("<%s%s%s%s%s%s%s> %s", TAG_CASE,
                     textAttr(KeyboardId.modeName(
@@ -444,7 +445,7 @@ public class KeyboardParser {
                     booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"),
                     booleanAttr(a, R.styleable.Keyboard_Case_hasVoiceKey, "hasVoiceKey"),
                     textAttr(KeyboardId.imeOptionsName(
-                            a.getInt(R.styleable.Keyboard_Case_imeOptions, -1)), "imeOptions"),
+                            a.getInt(R.styleable.Keyboard_Case_imeAction, -1)), "imeAction"),
                     Boolean.toString(selected)));
 
             return selected;
-- 
GitLab