mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
[IL132] Remove some calls that let a value escape.
Bug: 8636060 Change-Id: I696514934586ee71e734fd974026af8b2c866127
This commit is contained in:
parent
7ebd7ca9a4
commit
9320553ab9
@ -219,22 +219,15 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Update keyboard shift state triggered by connected EditText status change.
|
|
||||||
*/
|
|
||||||
public void updateShiftState() {
|
|
||||||
mState.onUpdateShiftState(mLatinIME.getCurrentAutoCapsState(),
|
|
||||||
mLatinIME.getCurrentRecapitalizeState());
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
|
// TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout
|
||||||
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
|
// when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal().
|
||||||
public void resetKeyboardStateToAlphabet() {
|
public void resetKeyboardStateToAlphabet() {
|
||||||
mState.onResetKeyboardStateToAlphabet();
|
mState.onResetKeyboardStateToAlphabet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPressKey(final int code, final boolean isSinglePointer) {
|
public void onPressKey(final int code, final boolean isSinglePointer,
|
||||||
mState.onPressKey(code, isSinglePointer, mLatinIME.getCurrentAutoCapsState());
|
final int currentAutoCapsState) {
|
||||||
|
mState.onPressKey(code, isSinglePointer, currentAutoCapsState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReleaseKey(final int code, final boolean withSliding) {
|
public void onReleaseKey(final int code, final boolean withSliding) {
|
||||||
@ -338,8 +331,8 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||||||
/**
|
/**
|
||||||
* Updates state machine to figure out when to automatically switch back to the previous mode.
|
* Updates state machine to figure out when to automatically switch back to the previous mode.
|
||||||
*/
|
*/
|
||||||
public void onCodeInput(final int code) {
|
public void onCodeInput(final int code, final int currentAutoCapsState) {
|
||||||
mState.onCodeInput(code, mLatinIME.getCurrentAutoCapsState());
|
mState.onCodeInput(code, currentAutoCapsState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isShowingEmojiPalettes() {
|
public boolean isShowingEmojiPalettes() {
|
||||||
|
@ -197,7 +197,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
latinIme.mSettings.getCurrent());
|
latinIme.mSettings.getCurrent());
|
||||||
break;
|
break;
|
||||||
case MSG_UPDATE_SHIFT_STATE:
|
case MSG_UPDATE_SHIFT_STATE:
|
||||||
switcher.updateShiftState();
|
switcher.requestUpdatingShiftState();
|
||||||
break;
|
break;
|
||||||
case MSG_SHOW_GESTURE_PREVIEW_AND_SUGGESTION_STRIP:
|
case MSG_SHOW_GESTURE_PREVIEW_AND_SUGGESTION_STRIP:
|
||||||
if (msg.arg1 == ARG1_NOT_GESTURE_INPUT) {
|
if (msg.arg1 == ARG1_NOT_GESTURE_INPUT) {
|
||||||
@ -833,7 +833,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
// we need to re-evaluate the shift state, but not the whole layout which would be
|
// we need to re-evaluate the shift state, but not the whole layout which would be
|
||||||
// disruptive.
|
// disruptive.
|
||||||
// Space state must be updated before calling updateShiftState
|
// Space state must be updated before calling updateShiftState
|
||||||
switcher.updateShiftState();
|
switcher.requestUpdatingShiftState();
|
||||||
}
|
}
|
||||||
// This will set the punctuation suggestions if next word suggestion is off;
|
// This will set the punctuation suggestions if next word suggestion is off;
|
||||||
// otherwise it will clear the suggestion strip.
|
// otherwise it will clear the suggestion strip.
|
||||||
@ -912,7 +912,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
// TODO: find a better way to simulate actual execution.
|
// TODO: find a better way to simulate actual execution.
|
||||||
if (isInputViewShown() &&
|
if (isInputViewShown() &&
|
||||||
mInputLogic.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd)) {
|
mInputLogic.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd)) {
|
||||||
mKeyboardSwitcher.updateShiftState();
|
mKeyboardSwitcher.requestUpdatingShiftState();
|
||||||
}
|
}
|
||||||
|
|
||||||
mSubtypeState.currentSubtypeUsed();
|
mSubtypeState.currentSubtypeUsed();
|
||||||
@ -1231,7 +1231,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
mInputLogic.onCodeInput(mSettings.getCurrent(), event,
|
mInputLogic.onCodeInput(mSettings.getCurrent(), event,
|
||||||
mKeyboardSwitcher.getKeyboardShiftMode(), mHandler);
|
mKeyboardSwitcher.getKeyboardShiftMode(), mHandler);
|
||||||
updateStateAfterInputTransaction(completeInputTransaction);
|
updateStateAfterInputTransaction(completeInputTransaction);
|
||||||
mKeyboardSwitcher.onCodeInput(codePoint);
|
mKeyboardSwitcher.onCodeInput(codePoint, getCurrentAutoCapsState());
|
||||||
}
|
}
|
||||||
|
|
||||||
// A helper method to split the code point and the key code. Ultimately, they should not be
|
// A helper method to split the code point and the key code. Ultimately, they should not be
|
||||||
@ -1256,8 +1256,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
// TODO: have the keyboard pass the correct key code when we need it.
|
// TODO: have the keyboard pass the correct key code when we need it.
|
||||||
final Event event = Event.createSoftwareTextEvent(rawText, Event.NOT_A_KEY_CODE);
|
final Event event = Event.createSoftwareTextEvent(rawText, Event.NOT_A_KEY_CODE);
|
||||||
mInputLogic.onTextInput(mSettings.getCurrent(), event, mHandler);
|
mInputLogic.onTextInput(mSettings.getCurrent(), event, mHandler);
|
||||||
mKeyboardSwitcher.updateShiftState();
|
mKeyboardSwitcher.requestUpdatingShiftState();
|
||||||
mKeyboardSwitcher.onCodeInput(Constants.CODE_OUTPUT_TEXT);
|
mKeyboardSwitcher.onCodeInput(Constants.CODE_OUTPUT_TEXT, getCurrentAutoCapsState());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1500,7 +1500,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
mHandler.postUpdateShiftState();
|
mHandler.postUpdateShiftState();
|
||||||
break;
|
break;
|
||||||
case InputTransaction.SHIFT_UPDATE_NOW:
|
case InputTransaction.SHIFT_UPDATE_NOW:
|
||||||
mKeyboardSwitcher.updateShiftState();
|
mKeyboardSwitcher.requestUpdatingShiftState();
|
||||||
break;
|
break;
|
||||||
default: // SHIFT_NO_UPDATE
|
default: // SHIFT_NO_UPDATE
|
||||||
}
|
}
|
||||||
@ -1540,7 +1540,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
@Override
|
@Override
|
||||||
public void onPressKey(final int primaryCode, final int repeatCount,
|
public void onPressKey(final int primaryCode, final int repeatCount,
|
||||||
final boolean isSinglePointer) {
|
final boolean isSinglePointer) {
|
||||||
mKeyboardSwitcher.onPressKey(primaryCode, isSinglePointer);
|
mKeyboardSwitcher.onPressKey(primaryCode, isSinglePointer, getCurrentAutoCapsState());
|
||||||
hapticAndAudioFeedback(primaryCode, repeatCount);
|
hapticAndAudioFeedback(primaryCode, repeatCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,7 +537,7 @@ public final class InputLogic {
|
|||||||
// after typing some letters and a period, then gesturing; the keyboard is not in
|
// after typing some letters and a period, then gesturing; the keyboard is not in
|
||||||
// caps mode yet, but since a gesture is starting, it should go in caps mode,
|
// caps mode yet, but since a gesture is starting, it should go in caps mode,
|
||||||
// unless the user explictly said it should not.
|
// unless the user explictly said it should not.
|
||||||
keyboardSwitcher.updateShiftState();
|
keyboardSwitcher.requestUpdatingShiftState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mConnection.endBatchEdit();
|
mConnection.endBatchEdit();
|
||||||
@ -579,7 +579,7 @@ public final class InputLogic {
|
|||||||
promotePhantomSpace(settingsValues);
|
promotePhantomSpace(settingsValues);
|
||||||
mConnection.commitText(commitParts[0], 0);
|
mConnection.commitText(commitParts[0], 0);
|
||||||
mSpaceState = SpaceState.PHANTOM;
|
mSpaceState = SpaceState.PHANTOM;
|
||||||
keyboardSwitcher.updateShiftState();
|
keyboardSwitcher.requestUpdatingShiftState();
|
||||||
mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(
|
mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime(
|
||||||
getActualCapsMode(settingsValues,
|
getActualCapsMode(settingsValues,
|
||||||
keyboardSwitcher.getKeyboardShiftMode()), commitParts[0]);
|
keyboardSwitcher.getKeyboardShiftMode()), commitParts[0]);
|
||||||
@ -1821,7 +1821,7 @@ public final class InputLogic {
|
|||||||
}
|
}
|
||||||
// Space state must be updated before calling updateShiftState
|
// Space state must be updated before calling updateShiftState
|
||||||
mSpaceState = SpaceState.PHANTOM;
|
mSpaceState = SpaceState.PHANTOM;
|
||||||
keyboardSwitcher.updateShiftState();
|
keyboardSwitcher.requestUpdatingShiftState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user