Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60adb875 authored by Kurt Partridge's avatar Kurt Partridge
Browse files

clean up researchLogging of autocorrection

remove dependence of ResearchLogger on LatinImeLogger
for autocorrection

multi-project commit with I32cc134b

Bug: 6188932
Change-Id: Iaeda97eb43fa4782db2d1b2a6d8d09a93b395111
parent 45213ed2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1783,6 +1783,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
                        + "is empty? Impossible! I must commit suicide.");
            }
            Utils.Stats.onAutoCorrection(typedWord, autoCorrection.toString(), separatorCodePoint);
            if (ProductionFlag.IS_EXPERIMENTAL) {
                ResearchLogger.LatinIME_commitCurrentAutoCorrection(typedWord,
                        autoCorrection.toString());
            }
            mExpectingUpdateSelection = true;
            commitChosenWord(autoCorrection, LastComposedWord.COMMIT_TYPE_DECIDED_WORD,
                    separatorCodePoint);
+13 −1
Original line number Diff line number Diff line
@@ -354,6 +354,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
                = DEFAULT_ENABLED;
        private static final boolean KEYBOARDSTATE_TOGGLEALPHABETANDSYMBOLS_ENABLED
                = DEFAULT_ENABLED;
        private static final boolean LATINIME_COMMITCURRENTAUTOCORRECTION_ENABLED = DEFAULT_ENABLED;
        private static final boolean LATINIME_ONDISPLAYCOMPLETIONS_ENABLED = DEFAULT_ENABLED;
        private static final boolean LATINIME_ONSTARTINPUTVIEWINTERNAL_ENABLED = DEFAULT_ENABLED;
        private static final boolean LATINIME_ONUPDATESELECTION_ENABLED = DEFAULT_ENABLED;
@@ -574,6 +575,17 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
        }
    }

    public static void LatinIME_commitCurrentAutoCorrection(final String typedWord,
            final String autoCorrection) {
        if (UnsLogGroup.LATINIME_COMMITCURRENTAUTOCORRECTION_ENABLED) {
            if (typedWord.equals(autoCorrection)) {
                getInstance().logCorrection("[----]", typedWord, autoCorrection, -1);
            } else {
                getInstance().logCorrection("[Auto]", typedWord, autoCorrection, -1);
            }
        }
    }

    public static void latinIME_onDisplayCompletions(
            final CompletionInfo[] applicationSpecifiedCompletions) {
        if (UnsLogGroup.LATINIME_ONDISPLAYCOMPLETIONS_ENABLED) {