Skip to content
Snippets Groups Projects
Commit c88026e1 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Update shift state when alphabet keyboard has been set

Bug: 5857492
Change-Id: I5ef78af21a76e8cf645e223d1ffa6212690bb1eb
parent 327c6828
No related branches found
No related tags found
No related merge requests found
...@@ -324,6 +324,12 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, ...@@ -324,6 +324,12 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
setKeyboard(mKeyboardSet.getSymbolsShiftedKeyboard()); setKeyboard(mKeyboardSet.getSymbolsShiftedKeyboard());
} }
// Implements {@link KeyboardState.SwitchActions}.
@Override
public void requestUpdatingShiftState() {
mState.onUpdateShiftState(mInputMethodService.getCurrentAutoCapsState());
}
public boolean isInMomentarySwitchState() { public boolean isInMomentarySwitchState() {
return mState.isInMomentarySwitchState(); return mState.isInMomentarySwitchState();
} }
......
...@@ -53,6 +53,11 @@ public class KeyboardState { ...@@ -53,6 +53,11 @@ public class KeyboardState {
public void setSymbolsKeyboard(); public void setSymbolsKeyboard();
public void setSymbolsShiftedKeyboard(); public void setSymbolsShiftedKeyboard();
/**
* Request to call back {@link KeyboardState#onUpdateShiftState(boolean)}.
*/
public void requestUpdatingShiftState();
} }
private KeyboardShiftState mKeyboardShiftState = new KeyboardShiftState(); private KeyboardShiftState mKeyboardShiftState = new KeyboardShiftState();
...@@ -212,6 +217,7 @@ public class KeyboardState { ...@@ -212,6 +217,7 @@ public class KeyboardState {
mSwitchState = SWITCH_STATE_ALPHA; mSwitchState = SWITCH_STATE_ALPHA;
setShiftLocked(mPrevMainKeyboardWasShiftLocked); setShiftLocked(mPrevMainKeyboardWasShiftLocked);
mPrevMainKeyboardWasShiftLocked = false; mPrevMainKeyboardWasShiftLocked = false;
mSwitchActions.requestUpdatingShiftState();
} }
private void setSymbolsKeyboard() { private void setSymbolsKeyboard() {
......
...@@ -71,6 +71,11 @@ public class KeyboardStateTests extends AndroidTestCase { ...@@ -71,6 +71,11 @@ public class KeyboardStateTests extends AndroidTestCase {
mLayout = SYMBOLS_SHIFTED; mLayout = SYMBOLS_SHIFTED;
} }
@Override
public void requestUpdatingShiftState() {
mState.onUpdateShiftState(mAutoCaps);
}
public void toggleCapsLock() { public void toggleCapsLock() {
mState.onToggleCapsLock(); mState.onToggleCapsLock();
} }
...@@ -111,7 +116,6 @@ public class KeyboardStateTests extends AndroidTestCase { ...@@ -111,7 +116,6 @@ public class KeyboardStateTests extends AndroidTestCase {
public void onCancelInput(boolean isSinglePointer) { public void onCancelInput(boolean isSinglePointer) {
mState.onCancelInput(isSinglePointer); mState.onCancelInput(isSinglePointer);
} }
} }
private MockKeyboardSwitcher mSwitcher; private MockKeyboardSwitcher mSwitcher;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment