aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-04-15 02:24:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-15 02:24:41 +0000
commit82d3a56b094557514bffc2a3f22d08b58c495cba (patch)
tree29674a73f05d0a7653820ad80f5fd93ccedde9a6 /java
parent751dc070bf5cbf2534eb86f5dbc05ec38fcffbee (diff)
parentddc163988a7e2e910ff3cac26ed580bac123fda0 (diff)
downloadlatinime-82d3a56b094557514bffc2a3f22d08b58c495cba.tar.gz
latinime-82d3a56b094557514bffc2a3f22d08b58c495cba.tar.xz
latinime-82d3a56b094557514bffc2a3f22d08b58c495cba.zip
Merge "[IL134] Add an alternative path to getCurrentAutoCapsState"
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java5
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java18
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java3
3 files changed, 17 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 6131a9b17..3492a9175 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -194,8 +194,9 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
mState.onPressKey(code, isSinglePointer, currentAutoCapsState);
}
- public void onReleaseKey(final int code, final boolean withSliding) {
- mState.onReleaseKey(code, withSliding);
+ public void onReleaseKey(final int code, final boolean withSliding,
+ final int currentAutoCapsState, final int currentRecapitalizeState) {
+ mState.onReleaseKey(code, withSliding, currentAutoCapsState, currentRecapitalizeState);
}
public void onFinishSlidingInput() {
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index ec0b5c95f..12870fba7 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -28,7 +28,7 @@ import com.android.inputmethod.latin.utils.RecapitalizeStatus;
* This class contains all keyboard state transition logic.
*
* The input events are {@link #onLoadKeyboard()}, {@link #onSaveKeyboardState()},
- * {@link #onPressKey(int,boolean,int)}, {@link #onReleaseKey(int,boolean)},
+ * {@link #onPressKey(int,boolean,int)}, {@link #onReleaseKey(int,boolean,int,int)},
* {@link #onCodeInput(int,int)}, {@link #onFinishSlidingInput()},
* {@link #onUpdateShiftState(int,int)}, {@link #onResetKeyboardStateToAlphabet()}.
*
@@ -49,10 +49,13 @@ public final class KeyboardState {
public void setSymbolsKeyboard();
public void setSymbolsShiftedKeyboard();
+ // Legacy method. TODO: remove the following method.
+ public void requestUpdatingShiftState();
/**
* Request to call back {@link KeyboardState#onUpdateShiftState(int, int)}.
*/
- public void requestUpdatingShiftState();
+ public void requestUpdatingShiftState(final int currentAutoCapsState,
+ final int currentRecapitalizeState);
public void startDoubleTapShiftKeyTimer();
public boolean isInDoubleTapShiftKeyTimeout();
@@ -373,13 +376,14 @@ public final class KeyboardState {
}
}
- public void onReleaseKey(final int code, final boolean withSliding) {
+ public void onReleaseKey(final int code, final boolean withSliding,
+ final int currentAutoCapsState, final int currentRecapitalizeState) {
if (DEBUG_EVENT) {
Log.d(TAG, "onReleaseKey: code=" + Constants.printableCode(code)
+ " sliding=" + withSliding + " " + this);
}
if (code == Constants.CODE_SHIFT) {
- onReleaseShift(withSliding);
+ onReleaseShift(withSliding, currentAutoCapsState, currentRecapitalizeState);
} else if (code == Constants.CODE_CAPSLOCK) {
setShiftLocked(!mAlphabetShiftState.isShiftLocked());
} else if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) {
@@ -513,7 +517,8 @@ public final class KeyboardState {
}
}
- private void onReleaseShift(final boolean withSliding) {
+ private void onReleaseShift(final boolean withSliding, final int currentAutoCapsState,
+ final int currentRecapitalizeState) {
if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) {
// We are recapitalizing. We should match the keyboard state to the recapitalize
// state in priority.
@@ -536,7 +541,8 @@ public final class KeyboardState {
// After chording input, automatic shift state may have been changed depending on
// what characters were input.
mShiftKeyState.onRelease();
- mSwitchActions.requestUpdatingShiftState();
+ mSwitchActions.requestUpdatingShiftState(currentAutoCapsState,
+ currentRecapitalizeState);
return;
} else if (mAlphabetShiftState.isShiftLockShifted() && withSliding) {
// In shift locked state, shift has been pressed and slid out to other key.
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 0db247c4c..0261f092a 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1575,7 +1575,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// press matching call is {@link #onPressKey(int,int,boolean)} above.
@Override
public void onReleaseKey(final int primaryCode, final boolean withSliding) {
- mKeyboardSwitcher.onReleaseKey(primaryCode, withSliding);
+ mKeyboardSwitcher.onReleaseKey(primaryCode, withSliding, getCurrentAutoCapsState(),
+ getCurrentRecapitalizeState());
// If accessibility is on, ensure the user receives keyboard state updates.
if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {