Merge "Use same session id for typing and gesture."

This commit is contained in:
Keisuke Kuroyanagi 2013-09-12 03:16:42 +00:00 committed by Android (Google) Code Review
commit 76e431b315
3 changed files with 11 additions and 7 deletions

View file

@ -48,8 +48,9 @@ public final class Suggest {
// Session id for // Session id for
// {@link #getSuggestedWords(WordComposer,String,ProximityInfo,boolean,int)}. // {@link #getSuggestedWords(WordComposer,String,ProximityInfo,boolean,int)}.
// We are sharing the same ID between typing and gesture to save RAM footprint.
public static final int SESSION_TYPING = 0; public static final int SESSION_TYPING = 0;
public static final int SESSION_GESTURE = 1; public static final int SESSION_GESTURE = 0;
// TODO: rename this to CORRECTION_OFF // TODO: rename this to CORRECTION_OFF
public static final int CORRECTION_NONE = 0; public static final int CORRECTION_NONE = 0;

View file

@ -36,8 +36,8 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
const int *const xCoordinates, const int *const yCoordinates, const int *const times, const int *const xCoordinates, const int *const yCoordinates, const int *const times,
const int *const pointerIds, const bool isGeometric) { const int *const pointerIds, const bool isGeometric) {
ASSERT(isGeometric || (inputSize < MAX_WORD_LENGTH)); ASSERT(isGeometric || (inputSize < MAX_WORD_LENGTH));
mIsContinuousSuggestionPossible = mIsContinuousSuggestionPossible = (mHasBeenUpdatedByGeometricInput != isGeometric) ?
ProximityInfoStateUtils::checkAndReturnIsContinuousSuggestionPossible( false : ProximityInfoStateUtils::checkAndReturnIsContinuousSuggestionPossible(
inputSize, xCoordinates, yCoordinates, times, mSampledInputSize, inputSize, xCoordinates, yCoordinates, times, mSampledInputSize,
&mSampledInputXs, &mSampledInputYs, &mSampledTimes, &mSampledInputIndice); &mSampledInputXs, &mSampledInputYs, &mSampledTimes, &mSampledInputIndice);
if (DEBUG_DICT) { if (DEBUG_DICT) {
@ -155,6 +155,7 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
if (DEBUG_GEO_FULL) { if (DEBUG_GEO_FULL) {
AKLOGI("ProximityState init finished: %d points out of %d", mSampledInputSize, inputSize); AKLOGI("ProximityState init finished: %d points out of %d", mSampledInputSize, inputSize);
} }
mHasBeenUpdatedByGeometricInput = isGeometric;
} }
// This function basically converts from a length to an edit distance. Accordingly, it's obviously // This function basically converts from a length to an edit distance. Accordingly, it's obviously

View file

@ -46,10 +46,11 @@ class ProximityInfoState {
: mProximityInfo(0), mMaxPointToKeyLength(0.0f), mAverageSpeed(0.0f), : mProximityInfo(0), mMaxPointToKeyLength(0.0f), mAverageSpeed(0.0f),
mHasTouchPositionCorrectionData(false), mMostCommonKeyWidthSquare(0), mHasTouchPositionCorrectionData(false), mMostCommonKeyWidthSquare(0),
mKeyCount(0), mCellHeight(0), mCellWidth(0), mGridHeight(0), mGridWidth(0), mKeyCount(0), mCellHeight(0), mCellWidth(0), mGridHeight(0), mGridWidth(0),
mIsContinuousSuggestionPossible(false), mSampledInputXs(), mSampledInputYs(), mIsContinuousSuggestionPossible(false), mHasBeenUpdatedByGeometricInput(false),
mSampledTimes(), mSampledInputIndice(), mSampledLengthCache(), mSampledInputXs(), mSampledInputYs(), mSampledTimes(), mSampledInputIndice(),
mBeelineSpeedPercentiles(), mSampledNormalizedSquaredLengthCache(), mSpeedRates(), mSampledLengthCache(), mBeelineSpeedPercentiles(),
mDirections(), mCharProbabilities(), mSampledNearKeySets(), mSampledSearchKeySets(), mSampledNormalizedSquaredLengthCache(), mSpeedRates(), mDirections(),
mCharProbabilities(), mSampledNearKeySets(), mSampledSearchKeySets(),
mSampledSearchKeyVectors(), mTouchPositionCorrectionEnabled(false), mSampledSearchKeyVectors(), mTouchPositionCorrectionEnabled(false),
mSampledInputSize(0), mMostProbableStringProbability(0.0f) { mSampledInputSize(0), mMostProbableStringProbability(0.0f) {
memset(mInputProximities, 0, sizeof(mInputProximities)); memset(mInputProximities, 0, sizeof(mInputProximities));
@ -204,6 +205,7 @@ class ProximityInfoState {
int mGridHeight; int mGridHeight;
int mGridWidth; int mGridWidth;
bool mIsContinuousSuggestionPossible; bool mIsContinuousSuggestionPossible;
bool mHasBeenUpdatedByGeometricInput;
std::vector<int> mSampledInputXs; std::vector<int> mSampledInputXs;
std::vector<int> mSampledInputYs; std::vector<int> mSampledInputYs;