Fix a bug where autoshift would be ignored coming from emoji

Bug: 11123691
Change-Id: I36474e12e34af95051129840865015f85595411b
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index 9f9fdaa..dd98c17 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -327,6 +327,9 @@
         }
         mIsAlphabetMode = false;
         mIsEmojiMode = true;
+        // Remember caps lock mode and reset alphabet shift state.
+        mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked();
+        mAlphabetShiftState.setShiftLocked(false);
         mSwitchActions.setEmojiKeyboard();
     }