diff options
author | 2013-05-31 22:05:28 -0700 | |
---|---|---|
committer | 2013-06-02 19:17:31 -0700 | |
commit | f07024e0fa0854ae83e28ce2b187d687a7527b98 (patch) | |
tree | 2bcdcecfc9671a9fe99813c3463c31745691efcb /java/src/com/android/inputmethod/research/ResearchLogger.java | |
parent | a0c3e02d7168dd4cee4cad51491537dadb0362cc (diff) | |
download | latinime-f07024e0fa0854ae83e28ce2b187d687a7527b98.tar.gz latinime-f07024e0fa0854ae83e28ce2b187d687a7527b98.tar.xz latinime-f07024e0fa0854ae83e28ce2b187d687a7527b98.zip |
Compare scrubbed strings when uncommitting LogUnits
A LogUnit is only uncommitted if the LogUnit's word matches what is
expected. But a LogUnit never stores numbers, only scrubbed words that
replace numbers with a special character. So when uncommitting, the
text from the TextView must also be scrubbed for the comparison to pass
correctly.
Bug: 9088919
Change-Id: I9b56f10afce6d0cc84eb9ead3b9a9b1e061ae39c
Diffstat (limited to 'java/src/com/android/inputmethod/research/ResearchLogger.java')
-rw-r--r-- | java/src/com/android/inputmethod/research/ResearchLogger.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index 56ab90cb4..3df2446f3 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -863,7 +863,10 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang // Check that expected word matches. if (oldLogUnit != null) { final String oldLogUnitWords = oldLogUnit.getWordsAsString(); - if (oldLogUnitWords != null && !oldLogUnitWords.equals(expectedWord)) { + // Because the word is stored in the LogUnit with digits scrubbed, the comparison must + // be made on a scrubbed version of the expectedWord as well. + if (oldLogUnitWords != null && !oldLogUnitWords.equals( + scrubDigitsFromString(expectedWord))) { return; } } |