Loading java/src/com/android/inputmethod/latin/ComposingStateManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,13 @@ public class ComposingStateManager { } } public synchronized boolean isComposing() { // TODO: use the composing flag in WordComposer instead of maintaining it // here separately. Even better, do away with this class and manage the auto // correction indicator in the same place as the suggestions. return mIsComposing; } public synchronized boolean isAutoCorrectionIndicatorOn() { return mAutoCorrectionIndicatorOn; } Loading java/src/com/android/inputmethod/latin/LatinIME.java +2 −3 Original line number Diff line number Diff line Loading @@ -1702,10 +1702,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (DEBUG) { Log.d(TAG, "Flip the indicator. " + oldAutoCorrectionIndicator + " -> " + newAutoCorrectionIndicator); if (newAutoCorrectionIndicator if (mComposingStateManager.isComposing() && newAutoCorrectionIndicator != mComposingStateManager.isAutoCorrectionIndicatorOn()) { throw new RuntimeException("Couldn't flip the indicator! We are not " + "composing a word right now."); throw new RuntimeException("Couldn't flip the indicator!"); } } final CharSequence textWithUnderline = Loading java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java +2 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,8 @@ import com.android.inputmethod.keyboard.ProximityInfo; import java.util.TreeMap; public class SpellCheckerProximityInfo { final private static int NUL = KeyDetector.NOT_A_CODE; /* public for test */ final public static int NUL = KeyDetector.NOT_A_CODE; // This must be the same as MAX_PROXIMITY_CHARS_SIZE else it will not work inside // native code - this value is passed at creation of the binary object and reused Loading native/src/defines.h +1 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ static void prof_out(void) { #define NOT_VALID_WORD -99 #define NOT_A_CHARACTER -1 #define NOT_A_DISTANCE -1 #define NOT_A_COORDINATE -1 #define EQUIVALENT_CHAR_WITHOUT_DISTANCE_INFO -2 #define PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO -3 #define NOT_A_INDEX -1 Loading native/src/proximity_info.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,9 @@ float ProximityInfo::calculateNormalizedSquaredDistance( if (!hasSweetSpotData(keyIndex)) { return NOT_A_DISTANCE_FLOAT; } if (NOT_A_COORDINATE == mInputXCoordinates[inputIndex]) { return NOT_A_DISTANCE_FLOAT; } const float squaredDistance = calculateSquaredDistanceFromSweetSpotCenter(keyIndex, inputIndex); const float squaredRadius = square(mSweetSpotRadii[keyIndex]); return squaredDistance / squaredRadius; Loading Loading
java/src/com/android/inputmethod/latin/ComposingStateManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,13 @@ public class ComposingStateManager { } } public synchronized boolean isComposing() { // TODO: use the composing flag in WordComposer instead of maintaining it // here separately. Even better, do away with this class and manage the auto // correction indicator in the same place as the suggestions. return mIsComposing; } public synchronized boolean isAutoCorrectionIndicatorOn() { return mAutoCorrectionIndicatorOn; } Loading
java/src/com/android/inputmethod/latin/LatinIME.java +2 −3 Original line number Diff line number Diff line Loading @@ -1702,10 +1702,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (DEBUG) { Log.d(TAG, "Flip the indicator. " + oldAutoCorrectionIndicator + " -> " + newAutoCorrectionIndicator); if (newAutoCorrectionIndicator if (mComposingStateManager.isComposing() && newAutoCorrectionIndicator != mComposingStateManager.isAutoCorrectionIndicatorOn()) { throw new RuntimeException("Couldn't flip the indicator! We are not " + "composing a word right now."); throw new RuntimeException("Couldn't flip the indicator!"); } } final CharSequence textWithUnderline = Loading
java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java +2 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,8 @@ import com.android.inputmethod.keyboard.ProximityInfo; import java.util.TreeMap; public class SpellCheckerProximityInfo { final private static int NUL = KeyDetector.NOT_A_CODE; /* public for test */ final public static int NUL = KeyDetector.NOT_A_CODE; // This must be the same as MAX_PROXIMITY_CHARS_SIZE else it will not work inside // native code - this value is passed at creation of the binary object and reused Loading
native/src/defines.h +1 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ static void prof_out(void) { #define NOT_VALID_WORD -99 #define NOT_A_CHARACTER -1 #define NOT_A_DISTANCE -1 #define NOT_A_COORDINATE -1 #define EQUIVALENT_CHAR_WITHOUT_DISTANCE_INFO -2 #define PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO -3 #define NOT_A_INDEX -1 Loading
native/src/proximity_info.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,9 @@ float ProximityInfo::calculateNormalizedSquaredDistance( if (!hasSweetSpotData(keyIndex)) { return NOT_A_DISTANCE_FLOAT; } if (NOT_A_COORDINATE == mInputXCoordinates[inputIndex]) { return NOT_A_DISTANCE_FLOAT; } const float squaredDistance = calculateSquaredDistanceFromSweetSpotCenter(keyIndex, inputIndex); const float squaredRadius = square(mSweetSpotRadii[keyIndex]); return squaredDistance / squaredRadius; Loading