diff --git a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
index 6a01b01..ea86d98 100644
--- a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
+++ b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
@@ -209,7 +209,7 @@
     private String getDescriptionForActionKey(final Context context, final Keyboard keyboard,
             final Key key) {
         final KeyboardId keyboardId = keyboard.mId;
-        final int actionId = keyboardId.imeActionId();
+        final int actionId = keyboardId.imeAction();
         final int resId;
 
         // Always use the label, if available.
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
index f9ff7b0..02116ca 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
@@ -172,12 +172,7 @@
     }
 
     public int imeAction() {
-        return InputTypeUtils.getActionIdFromEditorInfo(mEditorInfo);
-    }
-
-    public int imeActionId() {
-        final int actionId = imeAction();
-        return actionId == InputTypeUtils.IME_ACTION_CUSTOM_LABEL ? mEditorInfo.actionId : actionId;
+        return InputTypeUtils.getImeOptionsActionIdFromEditorInfo(mEditorInfo);
     }
 
     @Override
diff --git a/java/src/com/android/inputmethod/latin/InputTypeUtils.java b/java/src/com/android/inputmethod/latin/InputTypeUtils.java
index 55414b8..e2eacb3 100644
--- a/java/src/com/android/inputmethod/latin/InputTypeUtils.java
+++ b/java/src/com/android/inputmethod/latin/InputTypeUtils.java
@@ -105,7 +105,7 @@
         return true;
     }
 
-    public static int getActionIdFromEditorInfo(final EditorInfo editorInfo) {
+    public static int getImeOptionsActionIdFromEditorInfo(final EditorInfo editorInfo) {
         final int actionId = editorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
         if ((editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) {
             return EditorInfo.IME_ACTION_NONE;
@@ -115,4 +115,9 @@
             return actionId;
         }
     }
+
+    public static int getConcreteActionIdFromEditorInfo(final EditorInfo editorInfo) {
+        final int actionId = getImeOptionsActionIdFromEditorInfo(editorInfo);
+        return actionId == InputTypeUtils.IME_ACTION_CUSTOM_LABEL ? editorInfo.actionId : actionId;
+    }
 }
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 8913b15..8196252 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -166,6 +166,7 @@
     private boolean mExpectingUpdateSelection;
     private int mDeleteCount;
     private long mLastKeyTime;
+    private int mActionId;
 
     // Member variables for remembering the current device orientation.
     private int mDisplayOrientation;
@@ -754,6 +755,7 @@
 
         mLastSelectionStart = editorInfo.initialSelStart;
         mLastSelectionEnd = editorInfo.initialSelEnd;
+        mActionId = InputTypeUtils.getConcreteActionIdFromEditorInfo(editorInfo);
 
         mHandler.cancelUpdateSuggestionStrip();
         mHandler.cancelDoubleSpacePeriodTimer();
@@ -1272,10 +1274,6 @@
         return mOptionsDialog != null && mOptionsDialog.isShowing();
     }
 
-    private static int getActionId(final Keyboard keyboard) {
-        return keyboard != null ? keyboard.mId.imeActionId() : EditorInfo.IME_ACTION_NONE;
-    }
-
     private void performEditorAction(final int actionId) {
         mConnection.performEditorAction(actionId);
     }
@@ -1384,10 +1382,9 @@
             }
             break;
         case Constants.CODE_ACTION_ENTER:
-            final int actionId = getActionId(switcher.getKeyboard());
-            if (EditorInfo.IME_ACTION_NONE != actionId
-                && EditorInfo.IME_ACTION_UNSPECIFIED != actionId) {
-                performEditorAction(actionId);
+            if (EditorInfo.IME_ACTION_NONE != mActionId
+                && EditorInfo.IME_ACTION_UNSPECIFIED != mActionId) {
+                performEditorAction(mActionId);
                 break;
             }
             didAutoCorrect = handleNonSpecialCharacter(Constants.CODE_ENTER, x, y, spaceState);
