From 993acbaaa27505c8b1b95b66caf70ee98145b55c Mon Sep 17 00:00:00 2001 From: Kurt Partridge Date: Tue, 14 May 2013 12:01:55 -0700 Subject: [PATCH] Remove unnecessary commit/uncommit When the user reverts a commit, this causes the committed word to be changed. The user usually then goes back to edit that word. Going back to edit causes an uncommit, so that the editing actions are added onto the LogUnit containing the operations used to construct the word. But currently, reverting also involves its own commit/uncommit pair, with the caller performing the uncommit, and the commit happening inside the revert command. This may have been necessary in the past, when revert was called in different situations, but is unnecessary now. Furthermore, the guarding conditions are currently such that the uncommit doesn't always undo the effects of the commit, corrupting the log output. Change-Id: I74af41f4f1db2fcabfa496dcc4a2d7bd0af19b3a --- java/src/com/android/inputmethod/latin/LatinIME.java | 2 -- java/src/com/android/inputmethod/research/ResearchLogger.java | 1 - 2 files changed, 3 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 9caec5592..e5365dee2 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2572,8 +2572,6 @@ public final class LatinIME extends InputMethodService implements KeyboardAction if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_revertCommit(committedWord, originallyTypedWord, mWordComposer.isBatchMode(), mLastComposedWord.mSeparatorString); - ResearchLogger.getInstance().uncommitCurrentLogUnit(committedWord, - true /* dumpCurrentLogUnit */); } // Don't restart suggestion yet. We'll restart if the user deletes the // separator. diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index 8b8ea21e9..c5a6f6bae 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -1418,7 +1418,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang logUnit.setContainsCorrection(); } researchLogger.mStatistics.recordRevertCommit(SystemClock.uptimeMillis()); - researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord, Long.MAX_VALUE, isBatchMode); } /**