am 215fabff: Merge "Rename containsCorrection to containsUserDeletions"

* commit '215fabff523b1399b4aafaa09476747561d2127b':
  Rename containsCorrection to containsUserDeletions
main
Kurt Partridge 2013-05-28 16:42:43 -07:00 committed by Android Git Automerger
commit 4acf46e3ad
2 changed files with 14 additions and 14 deletions

View File

@ -67,7 +67,7 @@ public class LogUnit {
private String[] mWordArray = EMPTY_STRING_ARRAY;
private boolean mMayContainDigit;
private boolean mIsPartOfMegaword;
private boolean mContainsCorrection;
private boolean mContainsUserDeletions;
// mCorrectionType indicates whether the word was corrected at all, and if so, the nature of the
// correction.
@ -277,13 +277,13 @@ public class LogUnit {
}
// TODO: Refactor to eliminate getter/setters
public void setContainsCorrection() {
mContainsCorrection = true;
public void setContainsUserDeletions() {
mContainsUserDeletions = true;
}
// TODO: Refactor to eliminate getter/setters
public boolean containsCorrection() {
return mContainsCorrection;
public boolean containsUserDeletions() {
return mContainsUserDeletions;
}
// TODO: Refactor to eliminate getter/setters
@ -323,7 +323,7 @@ public class LogUnit {
true /* isPartOfMegaword */);
newLogUnit.mWords = null;
newLogUnit.mMayContainDigit = mMayContainDigit;
newLogUnit.mContainsCorrection = mContainsCorrection;
newLogUnit.mContainsUserDeletions = mContainsUserDeletions;
// Purge the logStatements and associated data from this LogUnit.
laterLogStatements.clear();
@ -346,7 +346,7 @@ public class LogUnit {
setWords(logUnit.mWords);
}
mMayContainDigit = mMayContainDigit || logUnit.mMayContainDigit;
mContainsCorrection = mContainsCorrection || logUnit.mContainsCorrection;
mContainsUserDeletions = mContainsUserDeletions || logUnit.mContainsUserDeletions;
mIsPartOfMegaword = false;
}

View File

@ -260,14 +260,14 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
if (DEBUG) {
final String wordsString = logUnit.getWordsAsString();
Log.d(TAG, "onPublish: '" + wordsString
+ "', hc: " + logUnit.containsCorrection()
+ "', hc: " + logUnit.containsUserDeletions()
+ ", cipd: " + canIncludePrivateData);
}
for (final String word : logUnit.getWordsAsStringArray()) {
final Dictionary dictionary = getDictionary();
mStatistics.recordWordEntered(
dictionary != null && dictionary.isValidWord(word),
logUnit.containsCorrection());
logUnit.containsUserDeletions());
}
}
publishLogUnits(logUnits, mMainResearchLog, canIncludePrivateData);
@ -819,8 +819,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
mCurrentLogUnit.setMayContainDigit();
}
private void setCurrentLogUnitContainsCorrection() {
mCurrentLogUnit.setContainsCorrection();
private void setCurrentLogUnitContainsUserDeletions() {
mCurrentLogUnit.setContainsUserDeletions();
}
private void setCurrentLogUnitCorrectionType(final int correctionType) {
@ -920,7 +920,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
if (DEBUG) {
Log.d(TAG, "publishLogBuffer: " + (logUnit.hasOneOrMoreWords()
? logUnit.getWordsAsString() : "<wordless>")
+ ", correction?: " + logUnit.containsCorrection());
+ ", correction?: " + logUnit.containsUserDeletions());
}
researchLog.publish(logUnit, canIncludePrivateData);
}
@ -1286,7 +1286,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
final ResearchLogger researchLogger = getInstance();
if (!replacedWord.equals(suggestion.toString())) {
// The user chose something other than what was already there.
researchLogger.setCurrentLogUnitContainsCorrection();
researchLogger.setCurrentLogUnitContainsUserDeletions();
researchLogger.setCurrentLogUnitCorrectionType(LogUnit.CORRECTIONTYPE_TYPO);
}
final String scrubbedWord = scrubDigitsFromString(suggestion);
@ -1463,7 +1463,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
LOGSTATEMENT_LATINIME_REVERTCOMMIT, committedWord, originallyTypedWord,
separatorString);
if (logUnit != null) {
logUnit.setContainsCorrection();
logUnit.setContainsUserDeletions();
}
researchLogger.mStatistics.recordRevertCommit(SystemClock.uptimeMillis());
}